-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
213 lines (183 loc) · 5.34 KB
/
flake.nix
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
};
outputs = { self, nixpkgs, flake-utils, nixos-hardware, home-manager, agenix }:
let
nixosSystem = import lib/nixosSystem.nix { inherit nixpkgs home-manager; };
homeConfig = import lib/homeConfig.nix { inherit nixpkgs home-manager; };
vmImage = import lib/vmImage.nix { inherit nixpkgs self; };
in {
# Lenovo Thinkpad X1 (7th Gen)
nixosConfigurations.aether = nixosSystem {
host = "aether";
system = "x86_64-linux";
hardware = nixos/targets/thinkpad_x1.nix;
modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-x1-7th-gen
nixos/modules/workstation.nix
nixos/modules/laptop.nix
nixos/modules/user-josh.nix
];
};
nixosConfigurations.straylight = nixosSystem {
host = "straylight";
system = "x86_64-linux";
hardware = nixos/targets/straylight.nix;
modules = [
./nixos/modules/server.nix
./nixos/modules/user-josh.nix
];
};
nixosConfigurations.x220 = nixosSystem {
host = "x220";
system = "x86_64-linux";
hardware = ./nixos/targets/thinkpad_x220.nix;
modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-x220
./nixos/modules/workstation.nix
./nixos/modules/laptop.nix
./nixos/modules/user-josh.nix
];
};
# new linux workstation for futzing with ml
nixosConfigurations.arcimedes = nixosSystem {
host = "arcimedes";
system = "x86_64-linux";
hardware = ./nixos/targets/efi-boot.nix;
modules = [
./nixos/modules/user-josh.nix
];
};
# oracle cloud a1 vm
nixosConfigurations.armitage = nixosSystem {
host = "armitage";
system = "aarch64-linux";
hardware = ./nixos/targets/oci.nix;
modules = [
./nixos/modules/server.nix
./nixos/modules/user-josh.nix
];
};
# Cobbled together i7-3770 workstation in the garage
nixosConfigurations.garage = nixosSystem {
host = "garage";
system = "x86_64-linux";
hardware = ./nixos/targets/ugh.nix;
};
# VPS
nixosConfigurations.mastzone = nixosSystem {
host = "mastzone";
system = "x86_64-linux";
hardware = ./nixos/targets/vps2day.nix;
};
# sigint -- radio intelligence
nixosConfigurations.sigint = nixosSystem {
host = "sigint";
system = "x86_64-linux";
hardware = ./nixos/targets/sigint.nix;
};
# mess-around lab virtualisation machine, 16 core xeon, 192GB ram
nixosConfigurations.kronos = nixosSystem {
host = "kronos";
system = "x86_64-linux";
hardware = ./nixos/targets/efi-boot.nix;
};
/*
VMs
*/
# shell host vm configuration
nixosConfigurations.shell = nixosSystem {
host = "shell";
system = "x86_64-linux";
hardware = ./nixos/targets/qemu-guest.nix;
};
nixosConfigurations.torrent = nixosSystem {
host = "torrent";
system = "x86_64-linux";
hardware = ./nixos/targets/qemu-guest.nix;
modules = [
./nixos/modules/server.nix
./nixos/modules/user-josh.nix
];
};
nixosConfigurations.ops = nixosSystem {
host = "ops";
system = "x86_64-linux";
hardware = ./nixos/targets/qemu-guest.nix;
modules = [
./nixos/modules/server.nix
./nixos/modules/user-josh.nix
];
};
# home k8s vm instance using k3s
nixosConfigurations.k8s = nixosSystem {
host = "k8s";
system = "x86_64-linux";
hardware = ./nixos/targets/qemu-guest.nix;
};
# testing/playground vm
nixosConfigurations.artemis = nixosSystem {
host = "artemis";
system = "x86_64-linux";
hardware = ./nixos/targets/qemu-guest.nix;
modules = [
./modules/server.nix
./modules/user-josh.nix
];
};
/*
Surprise! Turns out home-manager has flake support!
This is useful for providing my home configurations in non-NixOS contexts, like
my work laptop, WSL2, etc where previously I was setting up a separate ~/.config/nixpkgs/home.nix
file.
*/
homeConfigurations.macbook = homeConfig {
system = "aarch64-darwin";
modules = [
{
home.homeDirectory = nixpkgs.lib.mkOverride 10 "/Users/josh";
home.sessionPath = [
"$HOME/.rd/bin"
];
programs.ssh.matchBlocks."*".identityFile = [
"~/.ssh/josh@fulcradynamics.com.key"
];
}
hm/work.nix
hm/darwin.nix
hm/dev-tools.nix
];
};
homeConfigurations.wsl = homeConfig {
system = "x86_64-linux";
modules = [
hm/dev-tools.nix
];
};
/*
* EXPERIMENTAL STUFF
*/
build-vm = vmImage {
nixosConfiguration = self.nixosConfigurations.ops;
};
devShell.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.mkShell {
packages = with nixpkgs.legacyPackages.x86_64-linux; [
python311
openssh
rage
jq
];
};
};
}