summaryrefslogtreecommitdiff
path: root/hosts.nix
diff options
context:
space:
mode:
authorGrace Yoder <grace_yoder@outlook.com>2026-10-03 14:54:12 -0400
committerGrace Yoder <grace_yoder@outlook.com>2026-10-05 15:08:18 -0400
commitfdde154c63eeb8e6aac5129f9226f38c4b0b8bf0 (patch)
treee34e1728e20886595bb7db4bd81939f3b694d755 /hosts.nix
parent1f58bc3f3c9947c988567c8c16a853ff918f3e98 (diff)
hamano againvulcan
Diffstat (limited to 'hosts.nix')
-rw-r--r--hosts.nix47
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; }