1
1
mirror of https://github.com/ryantm/agenix.git synced 2024-09-11 06:05:38 +03:00

Merge pull request #57 from ryantm/workaround54

fix: workaround for #54
This commit is contained in:
Ryan Mulligan 2021-09-10 19:04:24 -07:00 committed by GitHub
commit 5c5bc28256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, options, lib, pkgs, ... }:
with lib; with lib;
@ -103,18 +103,29 @@ in
''; '';
}; };
}; };
config = mkIf (cfg.secrets != { }) { config = mkIf (cfg.secrets != { }) (mkMerge [
assertions = [{
assertion = cfg.sshKeyPaths != [ ];
message = "age.sshKeyPaths must be set.";
}];
# Secrets with root owner and group can be installed before users {
# exist. This allows user password files to be encrypted. assertions = [{
system.activationScripts.agenixRoot = stringAfter [ "specialfs" ] installRootOwnedSecrets; assertion = cfg.sshKeyPaths != [ ];
system.activationScripts.users.deps = [ "agenixRoot" ]; message = "age.sshKeyPaths must be set.";
}];
# Other secrets need to wait for users and groups to exist. # Secrets with root owner and group can be installed before users
system.activationScripts.agenix = stringAfter [ "users" "groups" "specialfs" ] installNonRootSecrets; # exist. This allows user password files to be encrypted.
}; system.activationScripts.agenixRoot = stringAfter [ "specialfs" ] installRootOwnedSecrets;
system.activationScripts.users.deps = [ "agenixRoot" ];
# Other secrets need to wait for users and groups to exist.
system.activationScripts.agenix = stringAfter [ "users" "groups" "specialfs" ] installNonRootSecrets;
}
# workaround for #54
(optionalAttrs (builtins.hasAttr "dryActivationScript" options.system) {
system.activationScripts.users.supportsDryActivation = mkForce false;
system.activationScripts.groups.supportsDryActivation = mkForce false;
})
]);
} }