-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
206 lines (194 loc) · 6.57 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
{
description = "NixOS systems and tools by muellerbernd";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
# nixpkgs.url = "github:nixos/nixpkgs/master";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-small";
# nixpkgs.url = "github:muellerbernd/nixpkgs/fix-thinkfan";
# nixpkgs.url = "git+file:///home/bernd/git/nixpkgs";
home-manager-unstable = {
# url = "github:nix-community/home-manager/release-23.11";
url = "github:nix-community/home-manager";
# We want to use the same set of nixpkgs as our system.
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
home-manager = {
# url = "github:nix-community/home-manager/release-24.05";
url = "github:nix-community/home-manager/release-24.11";
# We want to use the same set of nixpkgs as our system.
inputs.nixpkgs.follows = "nixpkgs";
};
# predefined hardware stuff
nixos-hardware.url = "github:nixos/nixos-hardware";
#
systems.url = "github:nix-systems/default-linux";
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
# hyprland = {
# # url = "github:hyprwm/Hyprland";
# # url = "github:muellerbernd/Hyprland/develop-movewindoworgroup";
# # url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
# # inputs.nixpkgs.follows = "nixpkgs";
# type = "git";
# url = "https://github.com/hyprwm/Hyprland";
# submodules = true;
# };
agenix.url = "github:ryantm/agenix";
disko.url = "github:nix-community/disko";
rofi-music-rs.url = "github:muellerbernd/rofi-music-rs";
lsleases.url = "github:muellerbernd/lsleases";
};
outputs = {
self,
nixpkgs,
home-manager,
systems,
agenix,
nixos-hardware,
...
} @ inputs: let
inherit (self) outputs;
mkDefault = import ./lib/mkdefault.nix;
lib = nixpkgs.lib // home-manager.lib;
forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system});
pkgsFor = lib.genAttrs (import systems) (
system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
}
);
in {
# custom images
images = {
pi4 =
(self.nixosConfigurations.pi4.extendModules {
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
{
disabledModules = ["profiles/base.nix"];
# Disable zstd compression
sdImage.compressImage = false;
}
];
})
.config
.system
.build
.sdImage;
pi-rover =
(self.nixosConfigurations.pi-rover.extendModules {
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
{
disabledModules = ["profiles/base.nix"];
# Disable zstd compression
sdImage.compressImage = false;
}
];
})
.config
.system
.build
.sdImage;
};
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
packages = forEachSystem (pkgs: import ./pkgs {inherit pkgs;});
# // {packages.aarch64-linux.pi4-sdImage = outputs.images.pi4;};
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forEachSystem (pkgs: pkgs.alejandra);
# formatter = forEachSystem (pkgs: pkgs.nixfmt-rfc-style);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
nixosModules = import ./modules/nixos;
nixosConfigurations = {
mue-p14s = mkDefault "mue-p14s" {
inherit nixpkgs home-manager agenix inputs outputs;
system = "x86_64-linux";
users = ["bernd"];
};
x240 = mkDefault "x240" {
inherit nixpkgs home-manager agenix inputs outputs;
system = "x86_64-linux";
};
ilmpad = mkDefault "t480" {
inherit nixpkgs home-manager agenix inputs outputs;
system = "x86_64-linux";
crypt_device = "/dev/disk/by-uuid/4e79e8f8-ed3e-48e0-9ff0-7b1a44b8f76c";
hostname = "ilmpad";
};
ammerapad = mkDefault "t480" {
inherit nixpkgs home-manager agenix inputs outputs;
system = "x86_64-linux";
crypt_device = "/dev/disk/by-uuid/38cfcbfc-ae82-4232-b4c8-c486f18a82b8";
hostname = "ammerapad";
};
fw13 = mkDefault "fw13" {
inherit nixpkgs home-manager agenix inputs outputs;
system = "x86_64-linux";
};
biltower = mkDefault "biltower" {
inherit nixpkgs home-manager agenix inputs outputs;
system = "x86_64-linux";
};
ISO = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-base.nix"
./hosts/iso/configuration.nix
];
};
# test VM
balodil = mkDefault "balodil" {
inherit nixpkgs home-manager agenix inputs outputs;
system = "x86_64-linux";
users = ["bernd"];
students = ["test1" "test2"];
};
# VM
nixetcup = mkDefault "nixetcup" {
inherit nixpkgs home-manager agenix inputs outputs;
system = "x86_64-linux";
users = ["bernd"];
headless = true;
};
# raspberry-pi-4
pi4 = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
nixos-hardware.nixosModules.raspberry-pi-4
"${inputs.nixpkgs}/nixos/modules/profiles/minimal.nix"
./hosts/pi-4/configuration.nix
./hosts/pi-4/pi-requirements.nix
];
};
# raspberry-pi-3 rover
pi-rover = inputs.nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
system = "aarch64-linux";
modules = [
inputs.nixos-hardware.nixosModules.raspberry-pi-3
"${inputs.nixpkgs}/nixos/modules/profiles/minimal.nix"
./hosts/pi-rover/configuration.nix
./hosts/pi-rover/pi-requirements.nix
];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations.bernd = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
modules = [
./users/bernd/home-manager.nix
];
extraSpecialArgs = {
inherit inputs outputs;
headless = false;
};
};
};
}