diff options
Diffstat (limited to 'hosts.nix')
| -rw-r--r-- | hosts.nix | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/hosts.nix b/hosts.nix new file mode 100644 index 0000000..e7bf6b1 --- /dev/null +++ b/hosts.nix @@ -0,0 +1,47 @@ +let + hosts = { + turing = { + user = "grace"; + home = "/Users/grace"; + system = "aarch64-darwin"; + type = "darwin"; + }; + + "cs.purdue.edu" = { + user = "yoder177"; + home = "/homes/yoder177"; + system = "x86_64-linux"; + type = "home"; + }; + + vulcan = { + user = "scie"; + home = "/home/scie"; + system = "x86_64-linux"; + type = "home"; + }; + + dijkstra = { + user = "scie"; + home = "/home/scie"; + system = "x86_64-linux"; + type = "home"; + }; + + knuth = { + user = "grace"; + home = "/home/scie"; + system = "x86_64-linux"; + type = "nixos"; + }; + }; + + hostname = builtins.getEnv "NIX_HOST"; + name = + if builtins.match "(.+\\.)?cs\\.purdue\\.edu" hostname != null then + "cs.purdue.edu" + else + builtins.head (builtins.split "\\." hostname); +in +(hosts.${name} or (throw "Set NIX_HOST to a host in hosts.nix (got '${hostname}').")) +// { inherit name; } |
