blob: ce4cf33fc9148217a761cc52e6e717b139d181c5 (
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
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
|
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
# The `follows` keyword in inputs is used for inheritance.
# Here, `inputs.nixpkgs` of home-manager isn't kept consistent with the `inputs.nixpkgs` of the current flake,
# to not avoid problems caused by different versions of nixpkgs dependencies.
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
# alternative nix compiler
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-3.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
#for device formatting
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
# for hyprvisoring
microvm = {
url = "github:astro/microvm.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# modern window compositor
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
nix-colors.url = "github:misterio77/nix-colors";
#community wayland nixpkgs
# nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
# anyrun - a wayland launcher
# anyrun = {
# url = "github:Kirottu/anyrun";
# inputs.nixpkgs.follows = "nixpkgs-unstable";
# };
# # generate iso/qcow2/docker/... image from nixos configuration
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
#secrets management, lock with git commit at 20xx/x/xx
#.........
##################### Some non-flake repositories #########################################
# # AstroNvim is an aesthetic and feature-ruch neovim config.
# astronvim = {
# url = "github:AstroNvim/AstroVnim/v3.36.0";
# flake = false;
# };
# useful nushell scripts, such as auto_completion
nushell-scripts = {
url = "github:doolphin/nu_scripts";
# url = "github:nushell/nu_scripts";
flake = false;
};
# ryan4yin wallpapers
wallpapers = {
url = "github:ryan4yin/wallpapers";
flake = false;
};
# # nur-ryan4yin = {
# url = "github:ryan4yin/nur-packages";
# # inputs.nixpkgs.follows "nixpkgs";
# };
# # riscv64 SBCs
# nixos-licheepi4a.url = "github:ryan4yin/nixos-licheepi4a";
# # nixos-jh7110.url = "github:ryan4yin/nixos-jh7110";
# aarch64 SBCs
# nixos-rk3588.url = "github:ryan4yin/nixos-rk3588";
############# Personal repositories ########################################
# # my private secrets, it's a private repository, you need to replace it with your own.
# # use ssh protocol to authenticate via ssh-agent/ssh-key, and shallow clone to save time
# mysecrets = {
# url = "";
# flake = false;
# };
##################### Color Schemes #######################################
#color scheme -catppuccin
catppuccin-btop = {
url = "github:catppuccin/btop";
flake = false;
};
catppuccin-bat = {
url = "github:catppuccin/bat";
flake = false;
};
catppuccin-alacritty = {
url = "github:catppuccin/alacritty";
flake = false;
};
catppuccin-helix = {
url = "github:catppuccin/helix";
flake = false;
};
catppuccin-starship = {
url = "github:catppuccin/starship";
flake = false;
};
catppuccin-hyprland = {
url = "github:catppuccin/hyprland";
flake = false;
};
# # the nixConfig here only affects the flake inself, not the system configuration!
# nixConfig = {
# experimental-features = ["nix-command" "flakes"];
# substituters = [
# #my own cache server
# "url-here"
# "https://cache.nixos.org"
# "https://hyprland.cachix.org"
# ];
# # nix community's cache server
# extra-substituters = [
# "https://nix-community.cachix.org"
# "https://nixpkgs-wayland.cachix.org"
# ];
# extra-trusted-public-keys = [
# "keys here"
# ];
# };
};
outputs = inputs@{ self, ... }: with inputs;
# packages.aarch64-linux = {
# # packages.x86_64-linux = {
# aarch64-installer = nixos-generators.nixosGenerate {
# system = "aarch64-linux";
# networking.hostname = "raspi";
# modules = [
# ./modules/users/defin.nix
# ./modules/nixos/system-packages.nix
# ];
# format = "sd-aarch64-installer";
# };
# };
let
inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib;
systems = [ "x86_64-linux" "aarch64-linux" ];
# forAllSystems = f: lib.genAttrs systems (system: f pkgsFor.${system});
pkgsFor = lib.genAttrs systems (system: import nixpkgs {
inherit system;
config.allowUnfree = true;
});
minimalHomeManagerSettings = [ # From github:MasterofNull/nixos config
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
}
# lib.nixosSystem {
# modules = [
# ./modules/nixos/nix-common.nix
# ./modules/nixos/environment.nix
# ./modules/nixos/system-packages.nix
# ./modules/users/defin.nix
# ./modules/users/root.nix
# ];
# # # Let 'nixos-version --json' know the Git revision of this flake. (for containers?)
# # system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
# # nix.registry.nixpkgs.flake = nixpkgs;
# }
];
# vm = lib.nixosSystem {
# system = "x86_64-linux";
# modules = [ ./default.nix ];
# };
foolcreekwireless = lib.nixosSystem { # vm for website
system = "x86_64-linux";
modules = minimalHomeManagerSettings ++ [ ./machines/vm/foolcreekwireless
home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; }
];
};
in {
inherit lib;
nixosModules = import ./modules/nixos;
# homeManagerModules = import ./modules/home-manager;
# templates = import ./templates;
# overlays = import ./overlays { inherit inputs outputs; };
# hydraJobs = import ./hydra.nix { inherit inputs outputs; };
# packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });
# devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
# formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
# wallpapers = inherit wallpapers; #NOTE broken
nixosConfigurations = {
khad = lib.nixosSystem { # Main desktop
modules = minimalHomeManagerSettings ++ [ ./machines/khad
lix-module.nixosModules.default
home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/home.nix; }
];
};
zenbook = lib.nixosSystem { # Personal laptop
# specialArgs = { inherit inputs; };
modules = minimalHomeManagerSettings ++ [ ./machines/zenbook
lix-module.nixosModules.default
# hyprland.homeManagerModules.default {wayland.windowManager.hyprland.enable = true;}
home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/home.nix; }
];
};
betsy = lib.nixosSystem { # work laptop
modules = minimalHomeManagerSettings ++ [ ./machines/betsy
# lix-module.nixosModules.default
home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/home.nix; }
];
};
doretta = lib.nixosSystem { # build server
modules = minimalHomeManagerSettings ++ [ ./machines/doretta
lix-module.nixosModules.default
microvm.nixosModules.host
home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/doretta.nix; }
];
};
bosco = lib.nixosSystem { # networking server
modules = minimalHomeManagerSettings ++ [ ./machines/bosco
# lix-module.nixosModules.default
home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; }
];
};
biski = lib.nixosSystem { # another networking server, physical instead of cloud
modules = minimalHomeManagerSettings ++ [ ./machines/biski
disko.nixosModules.disko
home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; }
];
};
picast = lib.nixosSystem { # anger at chromecast
modules = minimalHomeManagerSettings ++ [ ./machines/picast
home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; }
];
};
microvm-test = lib.nixosSystem { # test
system = "x86_64-linux";
modules = minimalHomeManagerSettings ++ [
microvm.nixosModules.microvm
# home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; }
{
networking.hostName = "microvm-test";
microvm.hypervisor = "qemu";
}
];
};
# foolcreekwireless = lib.nixosSystem { # vm for website
# modules = minimalHomeManagerSettings ++ [ ./machines/vm/foolcreekwireless
# home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; }
# ];
# };
live = lib.nixosSystem {
modules = minimalHomeManagerSettings ++ [
(nixpkgs + "/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix")
./machines/iso/configuration.nix
./modules/users/defin.nix
./modules/nixos/system-packages.nix
home-manager.nixosModules.home-manager { home-manager.users.defin = import ./home-manager/default.nix; }
{ nixpkgs.hostPlatform = "aarch64-linux"; }
];
};
livetest = lib.nixosSystem {
modules = [
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
{ nixpkgs.hostPlatform = "aarch64-linux"; }
];
};
# vm declarations for nix flake check
# foolcreek = foolcreekwireless;
};
vms = { # expose the build attribute directly
foolcreekwireless = foolcreekwireless.config.system.build.vm;
};
homeConfigurations = { #NOTE: no worky yet
# Standalone HM only
# # Desktop
# "defin@khad" = lib.homeManagerConfiguration {
# modules = [ ./home-manager/home.nix ];
# pkgs = pkgsFor.x86_64-linux;
# extraSpecialArgs = { inherit inputs outputs; };
# };
# Laptop
"defin@nixos-zenbook" = lib.homeManagerConfiguration {
modules = [ ./home-manager/home.nix ];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
};
};
};
}
|