diff options
Diffstat (limited to 'users/seth/nixos.nix')
| -rw-r--r-- | users/seth/nixos.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/users/seth/nixos.nix b/users/seth/nixos.nix new file mode 100644 index 0000000..3ef6584 --- /dev/null +++ b/users/seth/nixos.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + secretsDir, + ... +}: let + cfg = config.traits.users.seth; + enable = cfg.enable && cfg.manageSecrets; +in { + options.traits.users.seth = { + manageSecrets = + lib.mkEnableOption "automatic management of sercrets" + // { + default = config.traits.secrets.enable or false; + }; + }; + + imports = [./system.nix]; + + config = lib.mkIf enable { + age.secrets = { + sethPassword.file = secretsDir + "/sethPassword.age"; + }; + + users.users.seth = { + hashedPasswordFile = lib.mkDefault config.age.secrets.sethPassword.path; + }; + }; +} |
