summaryrefslogtreecommitdiff
path: root/hosts/default.nix
blob: 11f0046d74ec35eaeebe145fda5af12116447282 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
inputs:
with inputs; let
  common = {
    system = "x86_64-linux";
    builder = nixpkgsUnstable.lib.nixosSystem;

    modules = [
      ragenix.nixosModules.default
      home-manager.nixosModules.home-manager
      nur.nixosModules.nur

      self.nixosModules.getchoo
      users.seth.default

      {
        age = {
          identityPaths = ["/etc/age/key"];
          secrets = {
            rootPassword.file = "${self}/users/_secrets/rootPassword.age";
            sethPassword.file = "${self}/users/_secrets/sethPassword.age";
            pbodyPassword.file = "${self}/users/_secrets/pbodyPassword.age";
          };
        };

        nixpkgs = {
          overlays = [nur.overlay getchoo.overlays.default];
          config.allowUnfree = true;
        };

        nix = {
          registry = {
            getchoo.flake = getchoo;
            nixpkgs.flake = nixpkgsUnstable;
          };

          settings = {
            trusted-substituters = [
              "https://getchoo.cachix.org"
              "https://nix-community.cachix.org"
              "https://hercules-ci.cachix.org"
              "https://wurzelpfropf.cachix.org"
            ];

            trusted-public-keys = [
              "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="
              "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
              "hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0="
              "wurzelpfropf.cachix.org-1:ilZwK5a6wJqVr7Fyrzp4blIEkGK+LJT0QrpWr1qBNq0="
            ];
          };
        };

        nixos.enable = true;
        system.stateVersion = "23.05";
      }
    ];

    specialArgs = {};
  };
in {
  glados = {
    inherit (common) builder specialArgs system;
    modules =
      common.modules
      ++ [
        nixos-hardware.nixosModules.common-cpu-amd-pstate
        nixos-hardware.nixosModules.common-gpu-nvidia-nonprime
        nixos-hardware.nixosModules.common-pc-ssd
        lanzaboote.nixosModules.lanzaboote
        (import "${self}/modules/nixos/virtualisation.nix")
      ];
  };
  glados-wsl = {
    inherit (common) builder specialArgs system;
    modules =
      common.modules
      ++ [
        nixos-wsl.nixosModules.wsl
      ];
  };
  atlas = {
    builder = nixpkgs.lib.nixosSystem;
    inherit (common) specialArgs;
    system = "aarch64-linux";

    modules = [
      ragenix.nixosModules.default
      (import "${self}/modules/base")
      (import "${self}/modules/nixos")
      (import "${self}/modules/server")

      {
        age = {
          identityPaths = ["/etc/age/key"];
          secrets = {
            rootPassword.file = "${self}/users/_secrets/rootPassword.age";
            atlasPassword.file = "${self}/users/_secrets/atlasPassword.age";
          };
        };

        nix.registry.nixpkgs.flake = nixpkgs;

        _module.args.nixinate = {
          host = "164.152.17.183";
          sshUser = "atlas";
          buildOn = "remote";
          substituteOnTarget = true;
          hermetic = false;
        };
      }
    ];
  };
  p-body = {
    builder = nixpkgs.lib.nixosSystem;
    inherit (common) specialArgs system;

    modules = [
      ragenix.nixosModules.default
      guzzle_api.nixosModules.guzzle_api
      (import "${self}/modules/base")
      (import "${self}/modules/nixos")
      (import "${self}/modules/server")

      {
        age = {
          identityPaths = ["/etc/age/key"];
          secrets = {
            rootPassword.file = "${self}/users/_secrets/rootPassword.age";
            pbodyPassword.file = "${self}/users/_secrets/pbodyPassword.age";
          };
        };

        nix.registry.nixpkgs.flake = nixpkgs;

        _module.args.nixinate = {
          host = "167.99.145.73";
          sshUser = "p-body";
          buildOn = "remote";
          substituteOnTarget = true;
          hermetic = false;
        };
      }
    ];
  };
}