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