-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
executable file
·280 lines (237 loc) · 7.7 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
{
inputs = {
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-22-11.url = "github:NixOS/nixpkgs/nixos-22.11";
emojiedpkg.url = "github:sekunho/emojied";
oshismashpkg.url = "github:sekunho/oshismash";
sekunpkg.url = "github:sekunho/sekun.dev";
agenix.url = "github:ryantm/agenix";
gnawex.url = "github:gnawex/gnawex";
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs-stable";
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
# Private flakes
fontpkgs = {
url = "git+ssh://git@github.com/sekunho/fonts";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
dotfiles-private = {
url = "git+ssh://git@github.com/sekunho/dotfiles-private";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
tacohiropkg = {
url = "git+ssh://git@github.com/sekunho/tacohiro";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
};
outputs =
{ self
, nixpkgs-stable
, nixpkgs-unstable
, nixos-22-11
, emojiedpkg
, oshismashpkg
, tacohiropkg
, sekunpkg
, agenix
, nix-darwin
, home-manager
, gnawex
, fontpkgs
, dotfiles-private
, nixos-generators
}:
let
lib = nixpkgs-stable.lib;
system = {
x86_64-linux = "x86_64-linux";
aarch64-darwin = "aarch64-darwin";
};
# Thank you https://github.com/hlissner/dotfiles/blob/master/flake.nix
mkPkgs = system: pkgs: extraOverlays: import pkgs {
inherit system;
config.allowUnfree = true;
overlays = extraOverlays;
};
pkgsOverlay = system: final: prev: {
agenix = agenix.packages.${system}.default;
myfonts = fontpkgs.packages.${system};
emojied = emojiedpkg.packages.${system}.emojied;
oshismash = oshismashpkg.packages.${system}.oshismash;
blog = sekunpkg.packages.${system}.blog;
tacohiro = tacohiropkg.packages.${system}.tacohiro;
};
pkgs-22-11 = mkPkgs nixos-22-11 [ ];
gnawexpkgs = gnawex.packages.${system};
publicKeys = {
arceus.sekun = "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAINI269n68/pDDfMjkPaWeRUldzr1I/dWfUZl7sZPktwCAAAABHNzaDo= software@sekun.net";
blaziken.sekun = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE07iMNKunyBGdOq61DWKIBQYy77e1sm69lXaFofkmtp software@sekun.net";
};
pkgs = system: mkPkgs system nixpkgs-stable [ (pkgsOverlay system) ];
pkgs' = system: mkPkgs system nixpkgs-unstable [ ];
nix = system: (pkgs' system).nixVersions.nix_2_18;
in
{
packages = {
x86_64-linux = {
gce = nixos-generators.nixosGenerate {
system = "x86_64-linux";
format = "gce";
modules = [
./hosts/tacohiro/configuration.nix
];
specialArgs = {
inherit publicKeys;
};
};
};
aarch64-darwin = { };
};
devShells = {
x86_64-linux = {
default = (pkgs system.x86_64-linux).mkShell {
buildInputs = with (pkgs system.x86_64-linux); [
nil
nixpkgs-fmt
just
fzf
];
};
};
aarch64-darwin = {
default = (pkgs system.aarch64-darwin).mkShell {
buildInputs = with (pkgs system.aarch64-darwin); [
nil
nixpkgs-fmt
just
fzf
];
};
};
};
darwinConfigurations."blaziken" = nix-darwin.lib.darwinSystem {
modules = [
home-manager.darwinModules.default
./hosts/blaziken/configuration.nix
];
specialArgs = {
inherit self;
pkgs = pkgs "aarch64-darwin";
pkgs' = pkgs' "aarch64-darwin";
};
};
nixosConfigurations = {
# TODO: Move these to `hosts`, and move the existing modules to their
# own `modules` folder. e.g `modules/lucario/`
arceus = lib.nixosSystem {
system = system.x86_64-linux;
modules = [
agenix.nixosModules.age
tacohiropkg.nixosModules.x86_64-linux.default
./hosts/arceus/configuration.nix
./config/nix.nix
];
specialArgs = {
inherit (pkgs system.x86_64-linux) tacohiro;
nix = (nix system.x86_64-linux);
pkgs = pkgs system.x86_64-linux;
pkgs' = pkgs' system.x86_64-linux;
};
};
mew = lib.nixosSystem {
system = system.x86_64-linux;
modules = [
emojiedpkg.nixosModules.default
oshismashpkg.nixosModule
agenix.nixosModules.age
./config/nix.nix
./hosts/mew/configuration.nix
./services/fail2ban.nix
./services/tailscale.nix
];
specialArgs = {
inherit (pkgs system.x86_64-linux) jq emojied oshismash blog;
inherit (pkgs' system.x86_64-linux) tailscale;
inherit publicKeys;
pkgs = pkgs system.x86_64-linux;
pkgs' = pkgs' system.x86_64-linux;
nix = nix system.x86_64-linux;
};
};
roserade = lib.nixosSystem {
system = system.x86_64-linux;
modules = [
./config/nix.nix
./hosts/roserade/configuration.nix
./services/fail2ban.nix
./services/tailscale.nix
agenix.nixosModules.age
];
specialArgs = {
inherit (pkgs system.x86_64-linux) jq;
inherit (pkgs' system.x86_64-linux) tailscale;
inherit publicKeys;
pkgs = pkgs system.x86_64-linux;
nix = nix system.x86_64-linux;
};
};
tacohiro = lib.nixosSystem {
system = system.x86_64-linux;
modules = [
tacohiropkg.nixosModules.x86_64-linux.default
agenix.nixosModules.age
dotfiles-private.nixosModules.tacohiro
./config/nix.nix
./services/fail2ban.nix
];
specialArgs = {
pkgs = pkgs system.x86_64-linux;
nix = nix system.x86_64-linux;
inherit publicKeys;
inherit (pkgs system.x86_64-linux) tacohiro;
};
};
gnawex-staging = lib.nixosSystem {
system = system.x86_64-linux;
modules = [
gnawex.nixosModules.x86_64-linux.default
agenix.nixosModules.age
./hosts/gnawex/staging/configuration.nix
./config/nix.nix
./services/fail2ban.nix
];
specialArgs = {
pkgs = pkgs system.x86_64-linux;
nix = nix system.x86_64-linux;
inherit gnawexpkgs;
inherit publicKeys;
inherit (gnawexpkgs) gnawex;
};
};
lucario = lib.nixosSystem {
system = system.x86_64-linux;
modules = [
dotfiles-private.nixosModules.lucario
agenix.nixosModules.age
./services/fail2ban.nix
./services/tailscale.nix
./config/nix.nix
];
specialArgs = {
inherit (pkgs system.x86_64-linux) jq;
inherit (pkgs' system.x86_64-linux) tailscale;
inherit publicKeys;
pkgs = pkgs system.x86_64-linux;
nix = nix system.x86_64-linux;
};
};
};
};
}