diff options
Diffstat (limited to 'users')
| -rw-r--r-- | users/seth/darwin.nix | 17 | ||||
| -rw-r--r-- | users/seth/nixos.nix | 30 | ||||
| -rw-r--r-- | users/seth/system.nix | 36 |
3 files changed, 83 insertions, 0 deletions
diff --git a/users/seth/darwin.nix b/users/seth/darwin.nix new file mode 100644 index 0000000..e2c59c8 --- /dev/null +++ b/users/seth/darwin.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: let + cfg = config.traits.users.seth; +in { + imports = [./system.nix]; + + config = lib.mkMerge [ + (lib.mkIf cfg.enable { + home-manager.users.seth = { + seth.desktop.enable = false; + }; + }) + ]; +} 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; + }; + }) + ]; +} diff --git a/users/seth/system.nix b/users/seth/system.nix new file mode 100644 index 0000000..3ca1da1 --- /dev/null +++ b/users/seth/system.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: let + cfg = config.traits.users.seth; +in { + options.traits.users.seth = { + enable = lib.mkEnableOption "Seth's user & home configurations"; + }; + + config = lib.mkIf cfg.enable { + users.users.seth = + { + shell = pkgs.fish; + home = lib.mkDefault ( + if pkgs.stdenv.isDarwin + then "/Users/seth" + else "/home/seth" + ); + } + // lib.optionalAttrs pkgs.stdenv.isLinux { + extraGroups = ["wheel"]; + isNormalUser = true; + }; + + programs.fish.enable = lib.mkDefault true; + + home-manager.users.seth = { + imports = [inputs.self.homeModules.seth]; + seth.enable = true; + }; + }; +} |
