diff options
Diffstat (limited to 'users')
| -rw-r--r-- | users/seth/default.nix | 22 | ||||
| -rw-r--r-- | users/seth/home.nix | 19 |
2 files changed, 32 insertions, 9 deletions
diff --git a/users/seth/default.nix b/users/seth/default.nix index 1eb5ac2..8a2cfa7 100644 --- a/users/seth/default.nix +++ b/users/seth/default.nix @@ -1,14 +1,24 @@ { config, + lib, pkgs, ... }: { - users.users.seth = { - extraGroups = ["wheel"]; - isNormalUser = true; - shell = pkgs.fish; - passwordFile = config.age.secrets.sethPassword.path; - }; + users.users.seth = let + inherit (pkgs.stdenv) isLinux isDarwin; + in + lib.recursiveUpdate { + shell = pkgs.fish; + home = lib.optionalString (isLinux || isDarwin) ( + if isLinux + then "/home/seth" + else "/Users/seth" + ); + } (lib.optionalAttrs pkgs.stdenv.isLinux { + extraGroups = lib.optional pkgs.stdenv.isLinux "wheel"; + isNormalUser = true; + passwordFile = config.age.secrets.sethPassword.path; + }); programs.fish.enable = true; diff --git a/users/seth/home.nix b/users/seth/home.nix index e32f956..c24472b 100644 --- a/users/seth/home.nix +++ b/users/seth/home.nix @@ -1,12 +1,25 @@ -_: { +{ + lib, + pkgs, + ... +}: { imports = [ ./programs ./shell ]; - home = { + home = let username = "seth"; - homeDirectory = "/home/seth"; + inherit (pkgs.stdenv) isLinux isDarwin; + optionalLinuxDarwin = lib.optionalString (isLinux || isDarwin); + in { + inherit username; + homeDirectory = optionalLinuxDarwin ( + if isLinux + then "/home/${username}" + else "/Users/${username}" + ); + stateVersion = "23.11"; }; } |
