-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
220 lines (206 loc) · 6.33 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
{
description = "Nixos configuration flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware";
flake-utils.url = "github:numtide/flake-utils";
flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager-unstable = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
nixos-mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05";
inputs = {
nixpkgs.follows = "nixpkgs";
utils.follows = "flake-utils";
};
};
vscode-server.url = "github:nix-community/nixos-vscode-server";
website = {
url = "github:fbegyn/website";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
mac-app-util.url = "github:hraban/mac-app-util";
disko.url = "github:nix-community/disko";
};
outputs = inputs@{
self,
disko,
nixpkgs,
nixpkgs-unstable,
nixos-hardware,
darwin,
mac-app-util,
flake-utils-plus,
flake-utils,
home-manager,
home-manager-unstable,
lix-module,
agenix,
devshell,
emacs-overlay,
vscode-server,
website,
nixos-mailserver
}: let
overlay = final: prev: {
unstable = import nixpkgs-unstable {
system = prev.system;
inherit nixpkgs;
config.allowUnfree = true;
overlays = [
(import ./overlays/weechat.nix)
(import ./overlays/browser-eid.nix)
];
};
fbegyn = {
system = prev.system;
website = nixpkgs.callPackage ./fbegyn/website.nix {};
f1multiviewer = nixpkgs.callPackage ./fbegyn/f1multiviewer.nix {};
brother-hll2375dw-driver = nixpkgs.callPackage ./brother/drivers/hll2375dw-cups.nix {};
};
};
mkMachine = extraModules:
nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
({config, ...}: {
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
(import ./overlays/weechat.nix)
overlay
emacs-overlay.overlay
];
})
lix-module.nixosModules.default
agenix.nixosModules.age
home-manager.nixosModules.home-manager ({config, ...}: {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
})
./common
] ++ extraModules;
};
mkMac = extraModules:
darwin.lib.darwinSystem rec {
system = "aarch64-darwin";
modules = [
({config, ...}: {
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
overlay
emacs-overlay.overlay
];
})
agenix.nixosModules.age
lix-module.nixosModules.default
home-manager-unstable.darwinModules.home-manager ({config, ...}: {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
})
] ++ extraModules;
};
in {
devShells.x86_64-linux.default = nixpkgs.legacyPackages."x86_64-linux".mkShell {
buildInputs = [
agenix.packages.x86_64-linux.agenix
];
};
darwinConfigurations = {
erebus = mkMac [
./hosts/erebus/configuration.nix
mac-app-util.darwinModules.default
({pkgs, config, inputs, ...}: {
home-manager.users.francis.imports = [
mac-app-util.homeManagerModules.default
];
})
];
};
nixosConfigurations = let
cloud = import ./lib/cloud.nix {nixpkgs = nixpkgs;};
in {
horme = mkMachine [
./hosts/horme/configuration.nix
nixos-hardware.nixosModules.common-pc-laptop
nixos-hardware.nixosModules.common-pc-ssd
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.lenovo-thinkpad
nixos-hardware.nixosModules.lenovo-thinkpad-x1
];
bia = mkMachine [
./hosts/bia/configuration.nix
nixos-hardware.nixosModules.common-cpu-amd
vscode-server.nixosModules.default
];
ania = mkMachine [
./hosts/ania/configuration.nix
nixos-hardware.nixosModules.common-pc-laptop
nixos-hardware.nixosModules.common-pc-ssd
nixos-hardware.nixosModules.common-cpu-intel
];
eos = mkMachine [
./hosts/eos/configuration.nix
nixos-hardware.nixosModules.common-pc-ssd
nixos-hardware.nixosModules.common-cpu-intel
vscode-server.nixosModules.default
];
hosting-01 = cloud.mkCloudBox "hosting-01" {
extraModules = [
./hosts/hosting-01/configuration.nix
website.nixosModules.x86_64-linux.website
];
};
hosting-02 = cloud.mkCloudBox "hosting-02" {
extraModules = [
disko.nixosModules.disko
./lib/hosting.nix
./hosts/hosting-02/disko.nix
website.nixosModules.x86_64-linux.website
];
};
router-01 = mkMachine [
./hosts/router-01/configuration.nix
];
zima432 = mkMachine [
./hosts/zima432/configuration.nix
];
mail-01 = mkMachine [
./hosts/mail-01/configuration.nix
nixos-mailserver.nixosModules.mailserver
];
lan-app-01 = mkMachine [
./hosts/lan-party/app-01/configuration.nix
nixos-hardware.nixosModules.common-pc-ssd
nixos-hardware.nixosModules.common-cpu-intel
];
};
};
}