File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 1212 eachServiceCfg = config . mcl . secrets . services ;
1313 isDebugVM = config . mcl . host-info . isDebugVM ;
1414
15+ mcl-secrets = config . mcl . secrets ;
16+
1517 sshKey =
1618 if isDebugVM then
1719 config . virtualisation . vmVariant . mcl . host-info . sshKey
3638 ] ;
3739
3840 options . mcl . secrets = with lib ; {
41+ extraKeys = mkOption {
42+ type = types . listOf types . str ;
43+ default = [ ] ;
44+ example = [
45+ "ssh-ed25519 AAAAC3Nza"
46+ "ssh-ed25519 AAAACSNss"
47+ ] ;
48+ description = "Extra keys which can decrypt the secrets." ;
49+ } ;
50+
3951 services = mkOption {
4052 type = types . attrsOf (
4153 types . submodule (
8496 default = builtins . toFile "${ serviceName } -secrets.nix" ''
8597 let
8698 hostKey = ["${ sshKey } "];
87- extraKeys = ["${ concatStringsSep "\" \" " config . extraKeys } "];
99+ extraKeysPerService = ["${ concatStringsSep "\" \" " config . extraKeys } "];
100+ extraKeysPerHost = ["${ concatStringsSep "\" \" " mcl-secrets . extraKeys } "];
88101 in {
89- ${ concatMapStringsSep "\n " ( n : " \" ${ n } .age \" .publicKeys = hostKey ++ extraKeys;" ) (
90- builtins . attrNames config . secrets
91- ) }
102+ ${ concatMapStringsSep "\n " (
103+ n : " \" ${ n } .age \" .publicKeys = hostKey ++ extraKeysPerService ++ extraKeysPerHost;"
104+ ) ( builtins . attrNames config . secrets ) }
92105 }
93106 '' ;
94107 type = types . path ;
You can’t perform that action at this time.
0 commit comments