My personal nix config files. Feel free to import flake.
1{
2 description = "
3We still remember, we who dwell
4In this far land beneath the trees
5The starlight on the Western Seas.
6";
7 inputs = {
8 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
9 chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
10 alejandra.url = "github:kamadorueda/alejandra/3.0.0";
11 alejandra.inputs.nixpkgs.follows = "nixpkgs";
12 home-manager.url = "github:nix-community/home-manager";
13 home-manager.inputs.nixpkgs.follows = "nixpkgs";
14 nix-flatpak.url = "github:gmodena/nix-flatpak";
15 # nix-flatpak.inputs.nixpkgs.follows = "nixpkgs"; #
16 nixos-hardware.url = "github:NixOS/nixos-hardware/master";
17 # nixos-hardware.inputs.nixpkgs.follows = "nixpkgs"; #
18 impermanence.url = "github:nix-community/impermanence";
19 # impermanence.inputs.nixpkgs.follows = "nixpkgs"; #
20 nix-index-database.url = "github:nix-community/nix-index-database";
21 nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
22 plasma-manager = {
23 url = "github:nix-community/plasma-manager";
24 inputs.nixpkgs.follows = "nixpkgs";
25 inputs.home-manager.follows = "home-manager";
26 };
27 sddmSugarCandy4Nix = {
28 url = "github:MOIS3Y/sddmSugarCandy4Nix";
29 inputs.nixpkgs.follows = "nixpkgs";
30 };
31 disko.url = "github:nix-community/disko";
32 disko.inputs.nixpkgs.follows = "nixpkgs";
33 zen-browser.url = "github:youwen5/zen-browser-flake";
34 foundryvtt.url = "github:reckenrode/nix-foundryvtt";
35 rust-overlay.url = "github:oxalica/rust-overlay";
36 # ghostty.url = "github:ghostty-org/ghostty?ref=refs/tags/v1.1.3"; # latest: v1.1.3
37 ghostty = {
38 url = "github:ghostty-org/ghostty?ref=refs/tags/tip";
39 inputs.nixpkgs.follows = "nixpkgs";
40 };
41 pia = {
42 url = "github:Fuwn/pia.nix";
43 inputs.nixpkgs.follows = "nixpkgs";
44 };
45 bluepds = {
46 url = "github:Teqed/bluepds?rev=5de7c22468d3585952d33b469ac4edb1c3e9bba0";
47 inputs.nixpkgs.follows = "nixpkgs";
48 };
49 # rsky.url = "github:Teqed/rsky?rev=3a0f021490f17cd7faf95d1611c8cce7915232bd";
50 # rsky.url = "git+file:///home/teq/_/Repos/rsky";
51 nixpkgs-wayland = {
52 url = "github:nix-community/nixpkgs-wayland";
53 inputs.nixpkgs.follows = "nixpkgs";
54 };
55 # parakeet.url = "git+https://tangled.sh/@quilling.dev/parakeet?rev=3f1dcc059ddc28d94caea58076458c11dfd9e6db";
56 parakeet.url = "git+file:///home/teq/.local/user-dirs/Repos/parakeet";
57 };
58 outputs =
59 {
60 self,
61 nixpkgs,
62 home-manager,
63 alejandra,
64 chaotic,
65 nix-flatpak,
66 nixos-hardware,
67 impermanence,
68 nixpkgs-wayland,
69 nix-index-database,
70 plasma-manager,
71 disko,
72 foundryvtt,
73 rust-overlay,
74 ghostty,
75 pia,
76 bluepds,
77 # rsky,
78 ...
79 }@inputs:
80 let
81 inherit (self) outputs;
82 systems = [
83 "aarch64-linux"
84 # "i686-linux"
85 "x86_64-linux"
86 # "aarch64-darwin"
87 # "x86_64-darwin"
88 ];
89 forAllSystems = nixpkgs.lib.genAttrs systems; # This is a function that generates an attribute by calling a function you pass to it, with each system as an argument
90 inheritSpecialArgs = {
91 inherit
92 self
93 inputs
94 outputs
95 nixos-hardware
96 impermanence
97 nix-flatpak
98 nixpkgs-wayland
99 ;
100 };
101 # <system> is something like "x86_64-linux", "aarch64-linux", "i686-linux", "x86_64-darwin"
102 # <name> is an attribute name like "hello".
103 # <flake> is a flake name like "nixpkgs".
104 # <store-path> is a /nix/store.. path
105 in
106 {
107 # # Executed by `nix flake check`
108 # checks."<system>"."<name>" = derivation;
109
110 # # Executed by `nix build .#<name>`
111 # packages."<system>"."<name>" = derivation;
112 packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); # Custom packages accessible through 'nix build', 'nix shell', etc
113
114 # # Executed by `nix build .`
115 # packages."<system>".default = derivation;
116
117 # # Executed by `nix run .#<name>`
118 # apps."<system>"."<name>" = {
119 # type = "app";
120 # program = "<store-path>";
121 # };
122
123 # # Executed by `nix run . -- <args?>`
124 # apps."<system>".default = {
125 # type = "app";
126 # program = "...";
127 # };
128
129 # # Formatter (alejandra, nixfmt or nixpkgs-fmt)
130 # formatter."<system>" = derivation;
131 formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); # Formatter for your nix files, available through 'nix fmt'.
132
133 # # Used for nixpkgs packages, also accessible via `nix build .#<name>`
134 # legacyPackages."<system>"."<name>" = derivation;
135
136 # # Overlay, consumed by other flakes
137 # overlays."<name>" = final: prev: {};
138
139 # # Default overlay
140 # overlays.default = final: prev: {};
141
142 overlays = import ./overlays { inherit inputs; };
143
144 # # Nixos module, consumed by other flakes
145 # nixosModules."<name>" = {config, ...}: {
146 # options = {};
147 # config = {};
148 # };
149
150 # # Default module
151 # nixosModules.default = {config, ...}: {
152 # options = {};
153 # config = {};
154 # };
155 nixosModules = import ./modules/nixos { flakes = inputs; }; # Reusable nixos modules.
156
157 # # Used with `nixos-rebuild switch --flake .#<hostname>`
158 # # nixosConfigurations."<hostname>".config.system.build.toplevel must be a derivation
159 # nixosConfigurations."<hostname>" = {};
160 nixosConfigurations = {
161 eris = nixpkgs.lib.nixosSystem {
162 specialArgs = inheritSpecialArgs;
163 modules = [
164 ./hosts/eris.nix
165 self.nixosModules.default
166 chaotic.nixosModules.default
167 home-manager.nixosModules.home-manager
168 nix-flatpak.nixosModules.nix-flatpak
169 self.homeManagerConfig
170 disko.nixosModules.disko
171 ];
172 };
173 # NixOS configuration entrypoint. Available through 'nixos-rebuild --flake .#sedna'
174 sedna = nixpkgs.lib.nixosSystem {
175 specialArgs = inheritSpecialArgs;
176 modules = [
177 ./hosts/sedna.nix
178 self.nixosModules.default
179 chaotic.nixosModules.default
180 home-manager.nixosModules.home-manager
181 nix-flatpak.nixosModules.nix-flatpak
182 self.homeManagerConfig
183 ];
184 };
185 thoughtful = nixpkgs.lib.nixosSystem {
186 specialArgs = inheritSpecialArgs;
187 system = "x86_64-linux";
188 modules = [
189 ./hosts/thoughtful.nix
190 self.nixosModules.default
191 chaotic.nixosModules.default
192 home-manager.nixosModules.home-manager
193 nix-flatpak.nixosModules.nix-flatpak
194 self.homeManagerConfig
195 inputs.parakeet.nixosModules.default
196 ];
197 };
198 bubblegum = nixpkgs.lib.nixosSystem {
199 specialArgs = inheritSpecialArgs;
200 system = "x86_64-linux";
201 modules = [
202 ./hosts/bubblegum.nix
203 self.nixosModules.default
204 chaotic.nixosModules.default
205 home-manager.nixosModules.home-manager
206 nix-flatpak.nixosModules.nix-flatpak
207 self.homeManagerConfig
208 ];
209 };
210 jupiter = nixpkgs.lib.nixosSystem {
211 specialArgs = inheritSpecialArgs;
212 system = "aarch64-linux";
213 modules = [
214 ./hosts/jupiter.nix
215 self.nixosModules.default
216 chaotic.nixosModules.default
217 home-manager.nixosModules.home-manager
218 nix-flatpak.nixosModules.nix-flatpak
219 self.homeManagerConfig
220 disko.nixosModules.disko
221 inputs.foundryvtt.nixosModules.foundryvtt
222 inputs.bluepds.nixosModules.default
223 # inputs.rsky.nixosModules.default
224 inputs.parakeet.nixosModules.default
225 ];
226 };
227 };
228
229 # # Used by `nix develop .#<name>`
230 # devShells."<system>"."<name>" = derivation;
231
232 # # Used by `nix develop`
233 # devShells."<system>".default = derivation;
234
235 # # Hydra build jobs
236 # hydraJobs."<attr>"."<system>" = derivation;
237
238 # # Used by `nix flake init -t <flake>#<name>`
239 # templates."<name>" = {
240 # path = "<store-path>";
241 # description = "template description goes here?";
242 # };
243 # # Used by `nix flake init -t <flake>`
244 # templates.default = {
245 # path = "<store-path>";
246 # description = "";
247 # };
248
249 homeManagerModules = import ./modules/home-manager { flakes = inputs; }; # Reusable home-manager modules.
250 homeManagerConfig =
251 { ... }:
252 {
253 nixpkgs.hostPlatform = nixpkgs.lib.mkDefault "x86_64-linux";
254 home-manager.extraSpecialArgs = inheritSpecialArgs;
255 home-manager.sharedModules = [
256 self.homeManagerModules.default # My custom modules
257 nix-index-database.hmModules.nix-index # nix-index-database
258 plasma-manager.homeManagerModules.plasma-manager # plasma-manager
259 ];
260 };
261 homeConfigurations = {
262 # home-manager --flake .#teq@somewhere
263 "teq@somewhere" = home-manager.lib.homeManagerConfiguration {
264 pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
265 extraSpecialArgs = { inherit inputs outputs; };
266 modules = [
267 self.homeManagerModules.default # My custom modules
268 nix-index-database.hmModules.nix-index # nix-index-database
269 {
270 teq.home-manager = {
271 enable = true;
272 };
273 }
274 ];
275 };
276 };
277
278 devShells.x86_64-linux.thoughtful =
279 let
280 system = "x86_64-linux";
281 overlays = [ (import rust-overlay) ];
282 pkgs = import nixpkgs {
283 inherit system overlays;
284 };
285 rust = pkgs.rust-bin.selectLatestNightlyWith (
286 toolchain:
287 toolchain.default.override {
288 extensions = [
289 "rust-src" # for rust-analyzer
290 "rust-analyzer"
291 ];
292 targets = [ "wasm32-unknown-unknown" ];
293 }
294 );
295 buildInputs = with pkgs; [
296 udev
297 alsa-lib
298 vulkan-loader
299 xorg.libX11
300 xorg.libXcursor
301 xorg.libXi
302 xorg.libXrandr # To use the x11 feature
303 libxkbcommon
304 wayland # To use the wayland feature
305 openssl
306 pkg-config
307 gcc
308 pkg-config
309 rust
310 bacon
311 clippy
312 ];
313 in
314 nixpkgs.legacyPackages.x86_64-linux.mkShell {
315 nativeBuildInputs = with nixpkgs.legacyPackages.x86_64-linux; [
316 # cargo
317 # rustfmt
318 # bacon
319 # clippy
320 ];
321 buildInputs = buildInputs;
322 LD_LIBRARY_PATH = nixpkgs.legacyPackages.x86_64-linux.lib.makeLibraryPath buildInputs;
323 RUST_BACKTRACE = 1;
324 };
325 };
326}