-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
98 lines (97 loc) · 2.94 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
{
inputs = {
# nixpkgs
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-old.url = "github:NixOS/nixpkgs/nixos-24.05";
# tools
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim/nixos-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# hardware
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
raspberry-pi-nix.url = "github:nix-community/raspberry-pi-nix";
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, ... }@inputs:
{
stateVersion = "24.11";
baseModules = [
inputs.home-manager.nixosModules.home-manager
inputs.nixvim.nixosModules.nixvim
(import "${self}/pkgs/overlays.nix" { inherit inputs; })
(import "${self}/modules")
(import "${self}/src")
(import "${self}/src/base.nix")
(import "${self}/pkgs/base.nix")
];
optionalLocalModules =
nix_paths:
builtins.concatLists (
inputs.nixpkgs.lib.lists.forEach nix_paths (
path: inputs.nixpkgs.lib.optional (builtins.pathExists path) (import path)
)
);
systemTypes = {
z13g2 = prop: {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
stateVersion = self.stateVersion;
hostName = prop.hostName;
};
modules =
self.baseModules
++ [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-z13-gen2
(import "${self}/system/z13g2.nix")
(import "${self}/overrides/initrd-luks.nix")
(import "${self}/src/extra.nix")
(import "${self}/pkgs/extra.nix")
(import "${self}/modules/gui")
]
++ prop.modules;
};
wsl = prop: {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
stateVersion = self.stateVersion;
hostName = prop.hostName;
};
modules =
self.baseModules
++ [
inputs.nixos-wsl.nixosModules.wsl
(import "${self}/system/wsl.nix")
]
++ prop.modules;
};
rpi5 = prop: {
system = "aarch64-linux";
specialArgs = {
inherit inputs;
stateVersion = self.stateVersion;
hostName = prop.hostName;
};
modules =
self.baseModules
++ [
inputs.raspberry-pi-nix.nixosModules.raspberry-pi
(import "${self}/system/rpi5.nix")
]
++ prop.modules;
};
};
};
}