Nix configurations for my homelab
1{ ... }:
2{
3 imports = [
4 ./hardware.nix
5
6 ../modules/audio.nix
7 ../modules/basic.nix
8 ../modules/browsers.nix
9 ../modules/cloud-storage.nix
10 ../modules/creation.nix
11 ../modules/editor.nix
12 ../modules/electron.nix
13 ../modules/email.nix
14 ../modules/flatpak.nix
15 ../modules/fonts.nix
16 ../modules/fwupd.nix
17 ../modules/games.nix
18 ../modules/gui.nix
19 ../modules/hardware-keys.nix
20 ../modules/im.nix
21 ../modules/machine-id.nix
22 ../modules/machine-info.nix
23 ../modules/netbird.nix
24 ../modules/network-info.nix
25 ../modules/nix.nix
26 ../modules/printing.nix
27 ../modules/qbittorrent.nix
28 ../modules/remote-builder.nix
29 ../modules/river.nix
30 ../modules/smartd.nix
31 ../modules/tools.nix
32 ../modules/typst.nix
33 ../modules/uni.nix
34 ../modules/vpn-container.nix
35 ];
36
37 sops = {
38 defaultSopsFile = ../secrets/lutea.yaml;
39 defaultSopsFormat = "yaml";
40 age.keyFile = "/data/keys.txt";
41 };
42
43 networking.hostName = "lutea";
44 services.thermald.enable = true;
45
46 nix.settings = {
47 cores = 16;
48 max-jobs = 1;
49 };
50
51 fileSystems =
52 let
53 disk-uuid = "/dev/disk/by-uuid/7bf830d4-189d-4e9b-bcb0-565f4ac69e67";
54 in
55 {
56 "/home/mou/aud" = {
57 device = disk-uuid;
58 fsType = "btrfs";
59 options = [
60 "subvol=@home/mou/aud"
61 "compress=zstd"
62 "discard=async"
63 ];
64 };
65 "/home/mou/.cache" = {
66 device = disk-uuid;
67 fsType = "btrfs";
68 options = [
69 "subvol=@home/mou/cache"
70 "compress=zstd"
71 "discard=async"
72 ];
73 };
74 "/home/mou/.config" = {
75 device = disk-uuid;
76 fsType = "btrfs";
77 options = [
78 "subvol=@home/mou/config"
79 "compress=zstd"
80 "discard=async"
81 ];
82 };
83 "/home/mou/dls" = {
84 device = disk-uuid;
85 fsType = "btrfs";
86 options = [
87 "subvol=@home/mou/dls"
88 "compress=zstd"
89 "discard=async"
90 ];
91 };
92 "/home/mou/doc" = {
93 device = disk-uuid;
94 fsType = "btrfs";
95 options = [
96 "subvol=@home/mou/doc"
97 "compress=zstd"
98 "discard=async"
99 ];
100 };
101 "/home/mou/.local" = {
102 device = disk-uuid;
103 fsType = "btrfs";
104 options = [
105 "subvol=@home/mou/local"
106 "compress=zstd"
107 "discard=async"
108 ];
109 };
110 "/home/mou/misc" = {
111 device = disk-uuid;
112 fsType = "btrfs";
113 options = [
114 "subvol=@home/mou/misc"
115 "compress=zstd"
116 "discard=async"
117 ];
118 };
119 "/home/mou/pic" = {
120 device = disk-uuid;
121 fsType = "btrfs";
122 options = [
123 "subvol=@home/mou/pic"
124 "compress=zstd"
125 "discard=async"
126 ];
127 };
128 "/home/mou/vid" = {
129 device = disk-uuid;
130 fsType = "btrfs";
131 options = [
132 "subvol=@home/mou/vid"
133 "compress=zstd"
134 "discard=async"
135 ];
136 };
137 };
138
139 systemd.tmpfiles.settings."home-files" = {
140 "/home/mou/.barony".L.argument = "/home/mou/misc/games/barony";
141 "/home/mou/.mozilla".L.argument = "/home/mou/misc/.app-data/mozilla";
142 "/home/mou/.ssh".L.argument = "/home/mou/misc/.app-data/ssh";
143 "/home/mou/.var".L.argument = "/home/mou/misc/.app-data/flatpak-var";
144 "/home/mou/dls".d = {
145 user = "mou";
146 group = "mou";
147 age = "7d";
148 };
149 };
150
151 # This option defines the first version of NixOS you have installed on this particular machine,
152 # and is used to maintain compatibility with application data (e.g. databases) created on older
153 # NixOS versions. Most users should NEVER change this value after the initial install, for any
154 # reason, even if you've upgraded your system to a new NixOS release. This value does NOT affect
155 # the Nixpkgs version your packages and OS are pulled from, so changing it will NOT upgrade your
156 # system. This value being lower than the current NixOS release does NOT mean your system is out
157 # of date, out of support, or vulnerable. Do NOT change this value unless you have manually
158 # inspected all the changes it would make to your configuration, and migrated your data
159 # accordingly. For more information, see `man configuration.nix` or
160 # https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
161 system.stateVersion = "24.05"; # Did you read the comment?
162}