-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
flake.nix
232 lines (213 loc) · 8.19 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
{
description = "Wimpy's NixOS, nix-darwin and Home Manager Configuration";
inputs = {
#nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs.url = "https://flakehub.com/f/nixos/nixpkgs/0.2411.*";
nixpkgs-unstable.url = "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0";
auto-cpufreq.url = "github:AdnanHodzic/auto-cpufreq";
auto-cpufreq.inputs.nixpkgs.follows = "nixpkgs-unstable";
catppuccin.url = "github:catppuccin/nix";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixos-needsreboot.url = "https://codeberg.org/Mynacol/nixos-needsreboot/archive/0.2.2.tar.gz";
nixos-needsreboot.inputs.nixpkgs.follows = "nixpkgs";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
nix-index-database.url = "github:Mic92/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
nix-vscode-extensions.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
# FlakeHub
catppuccin-vsc.url = "https://flakehub.com/f/catppuccin/vscode/*.tar.gz";
catppuccin-vsc.inputs.nixpkgs.follows = "nixpkgs";
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/0";
fh.url = "https://flakehub.com/f/DeterminateSystems/fh/0";
antsy-alien-attack-pico.url = "https://flakehub.com/f/wimpysworld/antsy-alien-attack-pico/*.tar.gz";
antsy-alien-attack-pico.inputs.nixpkgs.follows = "nixpkgs";
nix-flatpak.url = "https://flakehub.com/f/gmodena/nix-flatpak/*.tar.gz";
nix-snapd.url = "https://flakehub.com/f/io12/nix-snapd/*.tar.gz";
nix-snapd.inputs.nixpkgs.follows = "nixpkgs";
quickemu.url = "https://flakehub.com/f/quickemu-project/quickemu/*.tar.gz";
quickemu.inputs.nixpkgs.follows = "nixpkgs";
quickgui.url = "https://flakehub.com/f/quickemu-project/quickgui/*.tar.gz";
quickgui.inputs.nixpkgs.follows = "nixpkgs";
stream-sprout.url = "https://flakehub.com/f/wimpysworld/stream-sprout/*.tar.gz";
stream-sprout.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{ self, nix-darwin, nixpkgs, ... }@inputs:
let
inherit (self) outputs;
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
stateVersion = "24.11";
helper = import ./lib { inherit inputs outputs stateVersion; };
in
{
# home-manager build --flake $HOME/Zero/nix-config -L
# home-manager switch -b backup --flake $HOME/Zero/nix-config
# nix run nixpkgs#home-manager -- switch -b backup --flake "${HOME}/Zero/nix-config"
homeConfigurations = {
# .iso images
"nixos@iso-console" = helper.mkHome {
hostname = "iso-console";
username = "nixos";
};
"nixos@iso-gnome" = helper.mkHome {
hostname = "iso-gnome";
username = "nixos";
desktop = "gnome";
};
"nixos@iso-lomiri" = helper.mkHome {
hostname = "iso-lomiri";
username = "nixos";
desktop = "lomiri";
};
"nixos@iso-mate" = helper.mkHome {
hostname = "iso-mate";
username = "nixos";
desktop = "mate";
};
"nixos@iso-pantheon" = helper.mkHome {
hostname = "iso-pantheon";
username = "nixos";
desktop = "pantheon";
};
# Workstations
"martin@phasma" = helper.mkHome {
hostname = "phasma";
desktop = "hyprland";
};
"martin@vader" = helper.mkHome {
hostname = "vader";
desktop = "hyprland";
};
"martin@shaa" = helper.mkHome {
hostname = "shaa";
desktop = "hyprland";
};
"martin@tanis" = helper.mkHome {
hostname = "tanis";
desktop = "hyprland";
};
"martin@momin" = helper.mkHome {
hostname = "momin";
platform = "aarch64-darwin";
desktop = "aqua";
};
"martin@krall" = helper.mkHome {
hostname = "krall";
platform = "x86_64-darwin";
desktop = "aqua";
};
# palpatine/sidious are dual boot hosts, WSL2/Ubuntu and NixOS respectively.
"martin@palpatine" = helper.mkHome { hostname = "palpatine"; };
"martin@sidious" = helper.mkHome {
hostname = "sidious";
desktop = "gnome";
};
# Servers
"martin@malak" = helper.mkHome { hostname = "malak"; };
"martin@revan" = helper.mkHome { hostname = "revan"; };
# Steam Deck
"deck@steamdeck" = helper.mkHome {
hostname = "steamdeck";
username = "deck";
};
# VMs
"martin@blackace" = helper.mkHome { hostname = "blackace"; };
"martin@defender" = helper.mkHome { hostname = "defender"; };
"martin@fighter" = helper.mkHome { hostname = "fighter"; };
"martin@crawler" = helper.mkHome { hostname = "crawler"; };
"martin@dagger" = helper.mkHome {
hostname = "dagger";
desktop = "pantheon";
};
};
nixosConfigurations = {
# .iso images
# - nix build .#nixosConfigurations.{iso-console|iso-gnome}.config.system.build.isoImage
iso-console = helper.mkNixos {
hostname = "iso-console";
username = "nixos";
};
iso-gnome = helper.mkNixos {
hostname = "iso-gnome";
username = "nixos";
desktop = "gnome";
};
iso-lomiri = helper.mkNixos {
hostname = "iso-lomiri";
username = "nixos";
desktop = "lomiri";
};
iso-mate = helper.mkNixos {
hostname = "iso-mate";
username = "nixos";
desktop = "mate";
};
iso-pantheon = helper.mkNixos {
hostname = "iso-pantheon";
username = "nixos";
desktop = "pantheon";
};
# Workstations
# - sudo nixos-rebuild boot --flake $HOME/Zero/nix-config
# - sudo nixos-rebuild switch --flake $HOME/Zero/nix-config
# - nix build .#nixosConfigurations.{hostname}.config.system.build.toplevel
# - nix run github:nix-community/nixos-anywhere -- --flake '.#{hostname}' root@{ip-address}
phasma = helper.mkNixos {
hostname = "phasma";
desktop = "hyprland";
};
vader = helper.mkNixos {
hostname = "vader";
desktop = "hyprland";
};
shaa = helper.mkNixos {
hostname = "shaa";
desktop = "hyprland";
};
tanis = helper.mkNixos {
hostname = "tanis";
desktop = "hyprland";
};
sidious = helper.mkNixos {
hostname = "sidious";
desktop = "gnome";
};
# Servers
malak = helper.mkNixos { hostname = "malak"; };
revan = helper.mkNixos { hostname = "revan"; };
# VMs
crawler = helper.mkNixos { hostname = "crawler"; };
dagger = helper.mkNixos {
hostname = "dagger";
desktop = "pantheon";
};
};
#nix run nix-darwin -- switch --flake ~/Zero/nix-config
#nix build .#darwinConfigurations.{hostname}.config.system.build.toplevel
darwinConfigurations = {
momin = helper.mkDarwin {
hostname = "momin";
};
krall = helper.mkDarwin {
hostname = "krall";
platform = "x86_64-darwin";
};
};
# Custom packages and modifications, exported as overlays
overlays = import ./overlays { inherit inputs; };
# Custom NixOS modules
nixosModules = import ./modules/nixos;
# Custom packages; acessible via 'nix build', 'nix shell', etc
packages = helper.forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for .nix files, available via 'nix fmt'
formatter = helper.forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
};
}