diff options
| author | seth <[email protected]> | 2024-02-03 19:27:26 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-02-03 20:47:55 -0500 |
| commit | fcc60b84e5e3cc44986d40af63f5de488caae909 (patch) | |
| tree | 45f4455c7dcbc63e59e62a9af79783e2e5509a2e /modules/shared/users | |
| parent | de003fa28e56b81a33e831099987cd94d2f53b39 (diff) | |
make everything a module
Diffstat (limited to 'modules/shared/users')
| -rw-r--r-- | modules/shared/users/default.nix | 11 | ||||
| -rw-r--r-- | modules/shared/users/seth.nix | 35 |
2 files changed, 46 insertions, 0 deletions
diff --git a/modules/shared/users/default.nix b/modules/shared/users/default.nix new file mode 100644 index 0000000..6e1a3f6 --- /dev/null +++ b/modules/shared/users/default.nix @@ -0,0 +1,11 @@ +{inputs, ...}: { + imports = [ + ./seth.nix + ]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = {inherit inputs;}; + }; +} diff --git a/modules/shared/users/seth.nix b/modules/shared/users/seth.nix new file mode 100644 index 0000000..0c98fc9 --- /dev/null +++ b/modules/shared/users/seth.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.users.seth; +in { + options.users.seth = { + enable = lib.mkEnableOption "Seth's configuration & home"; + }; + + 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; + hashedPasswordFile = lib.mkDefault config.age.secrets.sethPassword.path; + }; + + programs.fish.enable = lib.mkDefault true; + + home-manager.users.seth = { + imports = [../../../users/seth]; + }; + }; +} |
