diff options
| author | Grace Yoder <grace_yoder@outlook.com> | 2026-09-24 19:47:24 -0400 |
|---|---|---|
| committer | Grace Yoder <grace_yoder@outlook.com> | 2026-09-25 13:06:20 -0400 |
| commit | f6d8e3253f9aadce26cb9f7d51245e2691cd8627 (patch) | |
| tree | 84193b09b5e174737e165d6c22b2bc2c8935c9f2 /home.nix | |
| parent | ddf0c7981fbeaa6a45591a66132a330c804259ec (diff) | |
loadable hosts
Diffstat (limited to 'home.nix')
| -rwxr-xr-x | home.nix | 22 |
1 files changed, 5 insertions, 17 deletions
@@ -4,23 +4,12 @@ }: let - detectedHostname = - if builtins.match ".*-darwin" builtins.currentSystem != null then - "turing" - else - builtins.getEnv "HOSTNAME"; - detectedUsername = builtins.getEnv "USER"; - detectedHome = - let - envHome = builtins.getEnv "HOME"; - in - # Will not work on cs.purdue.edu - if envHome != "" then envHome else "/home/${detectedUsername}"; + host = import ./host.nix; in { home = { - username = lib.mkDefault detectedUsername; - homeDirectory = lib.mkDefault detectedHome; + username = host.user; + homeDirectory = host.home; }; imports = [ @@ -32,14 +21,13 @@ in ./home/langs.nix ./home/vcs.nix ] - ++ lib.optionals (detectedHostname == "turing") [ + ++ lib.optionals (host.name == "turing") [ ./home/packages.nix ./home/typst.nix ./home/pkgs_mac.nix ./home/ghostty.nix ] - ++ lib.optionals (lib.hasSuffix "cs.purdue.edu" detectedHostname) [ + ++ lib.optionals (lib.hasSuffix "cs.purdue.edu" host.name) [ ./home/cs_purdue.nix - ./home/ghostty.nix ]; } |
