From cffffeb678e9a1078eeba0f19c9607cda9f31bed Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 7 Feb 2024 18:03:24 -0500 Subject: modules/nixos+darwin: move to traits + archetypes model --- users/seth/nixos.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 users/seth/nixos.nix (limited to 'users/seth/nixos.nix') 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; + }; + }; +} -- cgit v1.2.3