-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
169 lines (150 loc) · 3.95 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
{
description = "Everything to restart from scratch: install media, OS, user environment";
inputs = {
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixpkgs.url = "github:NixOS/nixpkgs/master";
sops-nix.url = "github:Mic92/sops-nix/master";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs: let
inherit (inputs.home-manager.lib) homeManagerConfiguration;
inherit (inputs.nixpkgs.lib) nixosSystem;
# See https://discourse.nixos.org/t/do-flakes-also-set-the-system-channel/19798
channels = {
path = "/etc/nixpkgs/channels";
nixpkgsPath = "${channels.path}/nixpkgs";
};
hardware = inputs.nixos-hardware.nixosModules;
homeConfigurations = {
homestation = homeManagerConfiguration {
inherit pkgs;
modules = [
./homes/del
{
home = {
inherit stateVersion;
};
}
];
};
workstation = homeManagerConfiguration {
inherit pkgs;
modules = [
./homes/del
./homes/del/work
{
home = {
inherit stateVersion;
};
}
];
};
};
hosts = import ./hosts;
modules = {
dellLaptopHardware = [
hardware.common-cpu-intel
hardware.common-gpu-nvidia
hardware.common-pc-laptop
hardware.common-pc-laptop-ssd
];
workstation = [
inputs.sops-nix.nixosModules.sops
nixConfig
];
};
nixConfig = {
nix.nixPath = [
"nixpkgs=${channels.nixpkgsPath}"
"/nix/var/nix/profiles/per-user/root/channels"
];
system = {
inherit stateVersion;
};
systemd.tmpfiles.rules = [
"L+ ${channels.nixpkgsPath} - - - - ${pkgs.path}"
];
};
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
# See https://github.com/nix-community/home-manager/issues/4664
config.permittedInsecurePackages = [
"dotnet-core-combined"
"dotnet-sdk-6.0.428"
"dotnet-sdk-wrapped-6.0.428"
];
};
system = "x86_64-linux";
stateVersion = "23.11";
in {
homeConfigurations = {
del = homeConfigurations.homestation;
"del@hepao" = homeConfigurations.workstation;
"del@dante" = homeConfigurations.workstation;
"del@abelard" = homeConfigurations.workstation;
};
nixosConfigurations = {
abelard = nixosSystem {
inherit system;
modules =
[
hosts.abelard
]
++ modules.dellLaptopHardware
++ modules.workstation;
};
dante = nixosSystem {
inherit system;
modules =
[
hosts.dante
]
++ modules.dellLaptopHardware
++ modules.workstation;
};
echidna = nixosSystem {
modules = [
{imports = [./cross-build-aarch64.nix];}
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
hosts.echidna
nixConfig
];
};
hepao = nixosSystem {
inherit system;
modules =
[
hardware.framework-12th-gen-intel
hosts.hepao
]
++ modules.workstation;
};
installMedia = nixosSystem {
inherit system;
modules = [
{imports = [./install-media];}
"${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
nixConfig
];
};
kusanagi = nixosSystem {
inherit system;
modules =
[
hosts.kusanagi
]
++ modules.workstation;
};
testbox = nixosSystem {
inherit system;
modules = [
hosts.testbox
nixConfig
];
};
};
};
}