grace/dots

dotfiles/nix configs

git clone https://git.gae.moe/grace/dots

Grace Yoderhamano againa4b6f88

wafrn-testing
980 B47 linesraw
1let
2  hosts = {
3    turing = {
4      user = "grace";
5      home = "/Users/grace";
6      system = "aarch64-darwin";
7      type = "darwin";
8    };
9
10    "cs.purdue.edu" = {
11      user = "yoder177";
12      home = "/homes/yoder177";
13      system = "x86_64-linux";
14      type = "home";
15    };
16
17    vulcan = {
18      user = "scie";
19      home = "/home/scie";
20      system = "x86_64-linux";
21      type = "home";
22    };
23
24    dijkstra = {
25      user = "scie";
26      home = "/home/scie";
27      system = "x86_64-linux";
28      type = "home";
29    };
30
31    knuth = {
32      user = "grace";
33      home = "/home/scie";
34      system = "x86_64-linux";
35      type = "nixos";
36    };
37  };
38
39  hostname = builtins.getEnv "NIX_HOST";
40  name =
41    if builtins.match "(.+\\.)?cs\\.purdue\\.edu" hostname != null then
42      "cs.purdue.edu"
43    else
44      builtins.head (builtins.split "\\." hostname);
45in
46(hosts.${name} or (throw "Set NIX_HOST to a host in hosts.nix (got '${hostname}')."))
47// { inherit name; }