vars: eval finalScript lazy
This commit is contained in:
25
nixosModules/clanCore/vars/secret/on-machine.nix
Normal file
25
nixosModules/clanCore/vars/secret/on-machine.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
sortedGenerators = lib.toposort (a: b: builtins.elem a.name b.dependencies) (
|
||||
lib.attrValues config.clan.core.vars.generators
|
||||
);
|
||||
generateSecrets = ''
|
||||
${lib.concatStringsSep "\n" (_gen: ''
|
||||
v
|
||||
'') sortedGenerators}
|
||||
'';
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (config.clan.core.vars.settings.secretStore == "on-machine") {
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellApplication {
|
||||
text = generateSecrets;
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user