summaryrefslogtreecommitdiff
path: root/users/seth/nixos.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-02-07 18:03:24 -0500
committerseth <[email protected]>2024-02-07 18:27:45 -0500
commitcffffeb678e9a1078eeba0f19c9607cda9f31bed (patch)
tree8b8f68aa357becad06845f15b7e528474041371c /users/seth/nixos.nix
parent48712d44fde91d2685089cca7f9d88295fd59817 (diff)
modules/nixos+darwin: move to traits + archetypes model
Diffstat (limited to 'users/seth/nixos.nix')
-rw-r--r--users/seth/nixos.nix29
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;
+ };
+ };
+}