diff options
Diffstat (limited to 'hosts/vidhar')
-rw-r--r-- | hosts/vidhar/audiobookshelf/abs-podcast-autoplaylist-gkleen.toml | 19 | ||||
-rw-r--r-- | hosts/vidhar/audiobookshelf/default.nix | 21 | ||||
-rw-r--r-- | hosts/vidhar/default.nix | 2 | ||||
-rw-r--r-- | hosts/vidhar/kimai/default.nix | 89 | ||||
-rw-r--r-- | hosts/vidhar/kimai/ruleset.nft | 149 | ||||
-rw-r--r-- | hosts/vidhar/network/default.nix | 9 | ||||
-rw-r--r-- | hosts/vidhar/network/dhcp/default.nix | 93 | ||||
-rw-r--r-- | hosts/vidhar/network/ruleset.nft | 16 | ||||
-rw-r--r-- | hosts/vidhar/paperless/default.nix | 2 | ||||
-rw-r--r-- | hosts/vidhar/prometheus/default.nix | 3 |
10 files changed, 349 insertions, 54 deletions
diff --git a/hosts/vidhar/audiobookshelf/abs-podcast-autoplaylist-gkleen.toml b/hosts/vidhar/audiobookshelf/abs-podcast-autoplaylist-gkleen.toml new file mode 100644 index 00000000..a5319e38 --- /dev/null +++ b/hosts/vidhar/audiobookshelf/abs-podcast-autoplaylist-gkleen.toml | |||
@@ -0,0 +1,19 @@ | |||
1 | { | ||
2 | "data": "ENC[AES256_GCM,data:60OmHwuLC7RJVNNn8lsCFjIFrtDlmmT3yAm3DYn/K2b8OJB/lzKBhMUCyPpoI2lfMm6y47/DMwXI3ExH3QwfgGRf4i/Tcv7p6FCkjFgDc0RhAM7cXNSnh1gKTff8QYtPoNIzmycFCThNr7iZsPsf2/1npVaVHTnt9nTc+cmDLc+lELlvjSE00JOXch/if7KPwFww9K83XlrFmoRvwybfXR0unJqxK2XLvj+dQuKD4Bhyb88iSgu4dX1yw2uBSZBD16S4Io0DaZ+as5Yw4Kon7WMj3Jd5kz8ZxK+0NCy1CVJHOfJIwgYl0SVPp4DpbAPtJO4R/ciXyDQ/XGpoLtHjxnKXaJlJoSiA7FhuSEk+jB/peLHrYV1obdIRE5Dstly01S5cydKlfQ+A0TSjxFSWBYMEiD89sD09Br3iSJX5FejOoS8d2IQJ5faVzgQl4T5aBKsxCNNwmYrEe8m9HN7o2eer8nTKMln5IxZi3ZWhnjgJfrJ4QTXFndxCb78jo8HroN3+7VhoM136UZkqH1OMrIgAH/XSlW08G8m9MRamKsAWklq9aVflcEsPWTHmYW7rjAapQYf+jyK6BbfHcYmyKM82TFZ5iNB60Pth6EJgb2V8PZiChGvDzQvFYYOO3p9a/J8bVqsnPZBXXYcIBt42ZuRPvyyUTfM+75V1eYE9ZGFML+QlofwNCAg+/Rnl+RRy4z+8xQxd8Dn06geDpHsr4yND72FRUTKLbjxF5xfbzBRcZEXjGkyFdEAF7rB78I8xIqii+n6Yt8uEURmd4geI9KWXRQnwofTz9pklaAnRbER8zy/BJIiIYy8zecUHJn9v/DPnsnksfL6RRmG4tHaRBDbpAag0kVkCrpO/flK6dZOl/wvoVVVqT2O69a9/RpHLSV2f//ZS6L9s6vaYe4pXL0M6QymgA22sNHaws6XggJlTxVOFGRejMGYrKqVWtC+2UNbnel+/J0N1qj4luWfQaf9+1j+fq7vyLSzXYFCiyOLAznpqOhzKu6VWy2IbR0UnCoL5ZbhIba9e2MXM7Czy9Yee4xc=,iv:M0GbtFFl1XUeq+y9H+MiD+9z/ASB9hsd06KhpPzSwEo=,tag:vTLIIf+CeZN6DU25CSP8tw==,type:str]", | ||
3 | "sops": { | ||
4 | "age": [ | ||
5 | { | ||
6 | "recipient": "age1rmmhetcmllq0ahl5qznlr0eya2zdxwl9h6y5wnl97d2wtyx5t99sm2u866", | ||
7 | "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA0aE1XNUNCM1Q5V0d3R2JG\nbjJZTmdvQ21JbmtyR0ZmODFMdVBGejRoam1vCjMzMGdTb3BReDVCa2JJU0JrSHFP\ndTdicU5TRjIrTWpteDMzeGtDT0xaelkKLS0tIFhaSlFrbzFDUjRZV0lGR0cydVdZ\nY2xma0VSVXlTM1JucFJUSys4dlRvdEUK9gQNQEdKDDf1ikWzd6uTlE50WsfO/EB0\nGH2Ono6oNWbKWTyl/wRO8NzXx0nudwqq66s0oBLIdTMQOpIBBNI0XQ==\n-----END AGE ENCRYPTED FILE-----\n" | ||
8 | }, | ||
9 | { | ||
10 | "recipient": "age1qffdqvy9arld9zd5a5cylt0n98xhcns5shxhrhwjq5g4qa844ejselaa4l", | ||
11 | "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBiRWFqSHNlY1IvMkkwaEto\ncHZHa2p1Y25SakFkS2JYMlRFcFhnZGY1dVRFCkxSWmxvcHZMampQKzdKRHI0ZVMx\nUTFtR0pHbzFaQ0xQUFA2ZERDSWpwS0UKLS0tIFBaSGczY3VWdy9TKzRDZWZ2SElY\nbVQ4dDNhQllmVmViWGs5c3V4TmNscjQKeugevQJFAN/8JrzeAm4hm2JsQGb26BCb\n3dKYnN1kJU7oVHr1aVfXwMpELNYt9poX6WTY2h9lsdHuRlqoFXAA5Q==\n-----END AGE ENCRYPTED FILE-----\n" | ||
12 | } | ||
13 | ], | ||
14 | "lastmodified": "2025-05-10T10:25:15Z", | ||
15 | "mac": "ENC[AES256_GCM,data:dhj7e+vF3uiR6I22PR5tdNdM8EyrWmGGTIqjj8H7IdNIsZBHzjeHlBDFOwN7z/JMO0BVwIi4DmhApg2BSPGsQZGDQZ28UTCC8TDtd1zmfGtSP8R8AFHADYdLK/desMtHg6BZTnLv5tpba34WWdflMNOQpwgWPZsIk/DkLaoXdvk=,iv:qkoAZngTz2sfWdxDs+h8Mb2IrkF8gqnQoR5iRoeKjbY=,tag:zXrkBJmPM4ItJxMnX8IDxQ==,type:str]", | ||
16 | "unencrypted_suffix": "_unencrypted", | ||
17 | "version": "3.10.2" | ||
18 | } | ||
19 | } | ||
diff --git a/hosts/vidhar/audiobookshelf/default.nix b/hosts/vidhar/audiobookshelf/default.nix new file mode 100644 index 00000000..136bcaff --- /dev/null +++ b/hosts/vidhar/audiobookshelf/default.nix | |||
@@ -0,0 +1,21 @@ | |||
1 | { config, pkgs, lib, ... }: | ||
2 | |||
3 | { | ||
4 | config = { | ||
5 | services.audiobookshelf = { | ||
6 | enable = true; | ||
7 | host = "2a03:4000:52:ada:4:1::"; | ||
8 | port = 28982; | ||
9 | }; | ||
10 | |||
11 | users.groups.audiobookshelf.members = [ "gkleen" ]; | ||
12 | |||
13 | services.abs-podcast-autoplaylist = { | ||
14 | gkleen = {}; | ||
15 | }; | ||
16 | sops.secrets.${config.services.abs-podcast-autoplaylist.gkleen.configSecret} = { | ||
17 | format = "binary"; | ||
18 | sopsFile = ./abs-podcast-autoplaylist-gkleen.toml; | ||
19 | }; | ||
20 | }; | ||
21 | } | ||
diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix index 90ab40dd..7da17e6f 100644 --- a/hosts/vidhar/default.nix +++ b/hosts/vidhar/default.nix | |||
@@ -4,7 +4,7 @@ with lib; | |||
4 | 4 | ||
5 | { | 5 | { |
6 | imports = with flake.nixosModules.systemProfiles; [ | 6 | imports = with flake.nixosModules.systemProfiles; [ |
7 | ./zfs.nix ./network ./samba.nix ./dns ./prometheus ./borg ./pgbackrest ./postgresql.nix ./immich.nix ./paperless ./hledger | 7 | ./zfs.nix ./network ./samba.nix ./dns ./prometheus ./borg ./pgbackrest ./postgresql.nix ./immich.nix ./paperless ./hledger ./audiobookshelf ./kimai |
8 | tmpfs-root zfs | 8 | tmpfs-root zfs |
9 | initrd-all-crypto-modules default-locale openssh rebuild-machines | 9 | initrd-all-crypto-modules default-locale openssh rebuild-machines |
10 | build-server | 10 | build-server |
diff --git a/hosts/vidhar/kimai/default.nix b/hosts/vidhar/kimai/default.nix new file mode 100644 index 00000000..0258697b --- /dev/null +++ b/hosts/vidhar/kimai/default.nix | |||
@@ -0,0 +1,89 @@ | |||
1 | { flake, config, ... }: | ||
2 | |||
3 | { | ||
4 | config = { | ||
5 | boot.enableContainers = true; | ||
6 | boot.kernel.sysctl = { | ||
7 | "net.netfilter.nf_log_all_netns" = true; | ||
8 | }; | ||
9 | |||
10 | containers."kimai" = { | ||
11 | autoStart = true; | ||
12 | ephemeral = true; | ||
13 | bindMounts = { | ||
14 | "/var/lib/kimai" = { | ||
15 | hostPath = "/var/lib/kimai/state"; | ||
16 | isReadOnly = false; | ||
17 | }; | ||
18 | "/var/lib/mysql" = { | ||
19 | hostPath = "/var/lib/kimai/mysql"; | ||
20 | isReadOnly = false; | ||
21 | }; | ||
22 | }; | ||
23 | privateNetwork = true; | ||
24 | # forwardPorts = [ | ||
25 | # { containerPort = 80; | ||
26 | # hostPort = 28983; | ||
27 | # } | ||
28 | # ]; | ||
29 | hostAddress = "192.168.52.113"; | ||
30 | localAddress = "192.168.52.114"; | ||
31 | hostAddress6 = "2a03:4000:52:ada:6::1"; | ||
32 | localAddress6 = "2a03:4000:52:ada:6::2"; | ||
33 | config = let hostConfig = config; in { config, pkgs, lib, ... }: { | ||
34 | system.stateVersion = lib.mkIf hostConfig.containers."kimai".ephemeral config.system.nixos.release; | ||
35 | system.configurationRevision = lib.mkIf (flake ? rev) flake.rev; | ||
36 | nixpkgs.pkgs = hostConfig.nixpkgs.pkgs; | ||
37 | |||
38 | services.kimai.sites."kimai.yggdrasil.li" = { | ||
39 | database.socket = "/run/mysqld/mysqld.sock"; | ||
40 | }; | ||
41 | |||
42 | networking = { | ||
43 | useDHCP = false; | ||
44 | useNetworkd = true; | ||
45 | useHostResolvConf = false; | ||
46 | firewall.enable = false; | ||
47 | nftables = { | ||
48 | enable = true; | ||
49 | rulesetFile = ./ruleset.nft; | ||
50 | }; | ||
51 | }; | ||
52 | |||
53 | services.resolved.fallbackDns = [ | ||
54 | "9.9.9.10#dns10.quad9.net" | ||
55 | "149.112.112.10#dns10.quad9.net" | ||
56 | "2620:fe::10#dns10.quad9.net" | ||
57 | "2620:fe::fe:10#dns10.quad9.net" | ||
58 | ]; | ||
59 | |||
60 | systemd.network = { | ||
61 | networks.upstream = { | ||
62 | name = "eth0"; | ||
63 | matchConfig = { | ||
64 | Name = "eth0"; | ||
65 | }; | ||
66 | linkConfig = { | ||
67 | RequiredForOnline = true; | ||
68 | }; | ||
69 | networkConfig = { | ||
70 | Address = [ "192.168.52.114/32" "2a03:4000:52:ada:6::2/128" ]; | ||
71 | LLMNR = false; | ||
72 | MulticastDNS = false; | ||
73 | }; | ||
74 | routes = [ | ||
75 | { Destination = "192.168.52.113/32"; } | ||
76 | { Destination = "2a03:4000:52:ada:6::1/128"; } | ||
77 | { Destination = "0.0.0.0/0"; | ||
78 | Gateway = "192.168.52.113"; | ||
79 | } | ||
80 | { Destination = "::/0"; | ||
81 | Gateway = "2a03:4000:52:ada:6::1"; | ||
82 | } | ||
83 | ]; | ||
84 | }; | ||
85 | }; | ||
86 | }; | ||
87 | }; | ||
88 | }; | ||
89 | } | ||
diff --git a/hosts/vidhar/kimai/ruleset.nft b/hosts/vidhar/kimai/ruleset.nft new file mode 100644 index 00000000..ad4db6d5 --- /dev/null +++ b/hosts/vidhar/kimai/ruleset.nft | |||
@@ -0,0 +1,149 @@ | |||
1 | define icmp_protos = {ipv6-icmp, icmp, igmp} | ||
2 | |||
3 | table arp filter { | ||
4 | limit lim_arp { | ||
5 | rate over 50 mbytes/second burst 50 mbytes | ||
6 | } | ||
7 | |||
8 | counter arp-rx {} | ||
9 | counter arp-tx {} | ||
10 | |||
11 | counter arp-ratelimit-rx {} | ||
12 | counter arp-ratelimit-tx {} | ||
13 | |||
14 | chain input { | ||
15 | type filter hook input priority filter | ||
16 | policy accept | ||
17 | |||
18 | limit name lim_arp counter name arp-ratelimit-rx drop | ||
19 | |||
20 | counter name arp-rx | ||
21 | } | ||
22 | |||
23 | chain output { | ||
24 | type filter hook output priority filter | ||
25 | policy accept | ||
26 | |||
27 | limit name lim_arp counter name arp-ratelimit-tx drop | ||
28 | |||
29 | counter name arp-tx | ||
30 | } | ||
31 | } | ||
32 | |||
33 | table inet filter { | ||
34 | limit lim_reject { | ||
35 | rate over 1000/second burst 1000 packets | ||
36 | } | ||
37 | |||
38 | limit lim_icmp { | ||
39 | rate over 50 mbytes/second burst 50 mbytes | ||
40 | } | ||
41 | |||
42 | counter invalid-fw {} | ||
43 | counter fw-lo {} | ||
44 | |||
45 | counter reject-ratelimit-fw {} | ||
46 | counter reject-fw {} | ||
47 | counter reject-tcp-fw {} | ||
48 | counter reject-icmp-fw {} | ||
49 | |||
50 | counter drop-fw {} | ||
51 | |||
52 | counter invalid-rx {} | ||
53 | |||
54 | counter rx-lo {} | ||
55 | counter invalid-local4-rx {} | ||
56 | counter invalid-local6-rx {} | ||
57 | |||
58 | counter icmp-ratelimit-rx {} | ||
59 | counter icmp-rx {} | ||
60 | |||
61 | counter kimai-rx {} | ||
62 | |||
63 | counter established-rx {} | ||
64 | |||
65 | counter reject-ratelimit-rx {} | ||
66 | counter reject-rx {} | ||
67 | counter reject-tcp-rx {} | ||
68 | counter reject-icmp-rx {} | ||
69 | |||
70 | counter drop-rx {} | ||
71 | |||
72 | counter tx-lo {} | ||
73 | |||
74 | counter icmp-ratelimit-tx {} | ||
75 | counter icmp-tx {} | ||
76 | |||
77 | counter kimai-tx {} | ||
78 | |||
79 | counter tx {} | ||
80 | |||
81 | chain forward { | ||
82 | type filter hook forward priority filter | ||
83 | policy drop | ||
84 | |||
85 | |||
86 | ct state invalid log level debug prefix "kimai: drop invalid forward: " counter name invalid-fw drop | ||
87 | |||
88 | |||
89 | iifname lo counter name fw-lo accept | ||
90 | |||
91 | |||
92 | limit name lim_reject log level debug prefix "kimai: drop forward: " counter name reject-ratelimit-fw drop | ||
93 | log level debug prefix "kimai: reject forward: " counter name reject-fw | ||
94 | meta l4proto tcp ct state new counter name reject-tcp-fw reject with tcp reset | ||
95 | ct state new counter name reject-icmp-fw reject | ||
96 | |||
97 | |||
98 | counter name drop-fw | ||
99 | } | ||
100 | |||
101 | chain input { | ||
102 | type filter hook input priority filter | ||
103 | policy drop | ||
104 | |||
105 | |||
106 | ct state invalid log level debug prefix "kimai: drop invalid input: " counter name invalid-rx drop | ||
107 | |||
108 | |||
109 | iifname lo counter name rx-lo accept | ||
110 | iif != lo ip daddr 127.0.0.1/8 counter name invalid-local4-rx reject | ||
111 | iif != lo ip6 daddr ::1/128 counter name invalid-local6-rx reject | ||
112 | |||
113 | |||
114 | meta l4proto $icmp_protos limit name lim_icmp counter name icmp-ratelimit-rx drop | ||
115 | meta l4proto $icmp_protos counter name icmp-rx accept | ||
116 | |||
117 | |||
118 | tcp dport 80 counter name kimai-rx accept | ||
119 | |||
120 | |||
121 | ct state { established, related } counter name established-rx accept | ||
122 | |||
123 | |||
124 | limit name lim_reject log level debug prefix "kimai: drop input: " counter name reject-ratelimit-rx drop | ||
125 | log level debug prefix "kimai: reject input: " counter name reject-rx | ||
126 | meta l4proto tcp ct state new counter name reject-tcp-rx reject with tcp reset | ||
127 | ct state new counter name reject-icmp-rx reject | ||
128 | |||
129 | |||
130 | counter name drop-rx | ||
131 | } | ||
132 | |||
133 | chain output { | ||
134 | type filter hook output priority filter | ||
135 | policy accept | ||
136 | |||
137 | |||
138 | oifname lo counter name tx-lo accept | ||
139 | |||
140 | meta l4proto $icmp_protos limit name lim_icmp counter name icmp-ratelimit-tx drop | ||
141 | meta l4proto $icmp_protos counter name icmp-tx accept | ||
142 | |||
143 | |||
144 | tcp sport 80 counter name kimai-tx | ||
145 | |||
146 | |||
147 | counter name tx | ||
148 | } | ||
149 | } | ||
diff --git a/hosts/vidhar/network/default.nix b/hosts/vidhar/network/default.nix index 0643f0bb..92d755f3 100644 --- a/hosts/vidhar/network/default.nix +++ b/hosts/vidhar/network/default.nix | |||
@@ -103,7 +103,14 @@ with lib; | |||
103 | /srv/nfs/nix-store 10.141.0.0/24(ro,async,root_squash) 2a03:4000:52:ada:1::/80(ro,async,root_squash) | 103 | /srv/nfs/nix-store 10.141.0.0/24(ro,async,root_squash) 2a03:4000:52:ada:1::/80(ro,async,root_squash) |
104 | ''; | 104 | ''; |
105 | }; | 105 | }; |
106 | settings.nfsd.vers3 = false; | 106 | settings.nfsd = { |
107 | rdma = true; | ||
108 | vers3 = false; | ||
109 | vers4 = true; | ||
110 | "vers4.0" = false; | ||
111 | "vers4.1" = false; | ||
112 | "vers4.2" = true; | ||
113 | }; | ||
107 | }; | 114 | }; |
108 | 115 | ||
109 | fileSystems = { | 116 | fileSystems = { |
diff --git a/hosts/vidhar/network/dhcp/default.nix b/hosts/vidhar/network/dhcp/default.nix index f36d0c7f..11460393 100644 --- a/hosts/vidhar/network/dhcp/default.nix +++ b/hosts/vidhar/network/dhcp/default.nix | |||
@@ -5,6 +5,7 @@ with lib; | |||
5 | let | 5 | let |
6 | nfsrootBaseUrl = "http://nfsroot.vidhar.yggdrasil"; | 6 | nfsrootBaseUrl = "http://nfsroot.vidhar.yggdrasil"; |
7 | tftpIp = "10.141.0.1"; | 7 | tftpIp = "10.141.0.1"; |
8 | nfsIp = tftpIp; | ||
8 | ipxe = pkgs.ipxe.override { | 9 | ipxe = pkgs.ipxe.override { |
9 | additionalTargets = { | 10 | additionalTargets = { |
10 | "bin-i386-efi/ipxe.efi" = "i386-ipxe.efi"; | 11 | "bin-i386-efi/ipxe.efi" = "i386-ipxe.efi"; |
@@ -305,32 +306,30 @@ in { | |||
305 | pkgs.symlinkJoin { | 306 | pkgs.symlinkJoin { |
306 | name = "installer-${system}"; | 307 | name = "installer-${system}"; |
307 | paths = [ | 308 | paths = [ |
308 | (let | 309 | (builtins.addErrorContext "while evaluating installer-${system}-nfsroot" (let |
309 | installerBuild = (flake.nixosConfigurations.${"installer-${system}-nfsroot"}.extendModules { | 310 | installerBuild' = (flake.nixosConfigurations.${"installer-${system}-nfsroot"}.extendModules { |
310 | modules = [ | 311 | modules = [ |
311 | ({ ... }: { | 312 | ({ ... }: { |
312 | config.nfsroot.storeDevice = "${tftpIp}:nix-store"; | 313 | config.nfsroot.storeDevice = "${nfsIp}:nix-store"; |
313 | config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/installer-${system}/registration"; | 314 | config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/installer-${system}/registration"; |
315 | config.system.nixos.label = "installer-${system}"; | ||
314 | }) | 316 | }) |
315 | ]; | 317 | ]; |
316 | }).config.system.build; | 318 | }); |
317 | in builtins.toPath (pkgs.runCommandLocal "install-${system}" {} '' | 319 | installerBuild = installerBuild'.config.system.build; |
320 | in builtins.toPath (pkgs.runCommandLocal "installer-${system}" {} '' | ||
318 | mkdir -p $out/installer-${system} | 321 | mkdir -p $out/installer-${system} |
319 | install -m 0444 -t $out/installer-${system} \ | 322 | install -m 0444 -t $out/installer-${system} \ |
320 | ${installerBuild.initialRamdisk}/initrd \ | 323 | ${installerBuild.initialRamdisk}/initrd \ |
321 | ${installerBuild.kernel}/bzImage \ | 324 | ${installerBuild.kernel}/bzImage \ |
322 | ${installerBuild.netbootIpxeScript}/netboot.ipxe \ | 325 | ${installerBuild.netbootIpxeScript}/netboot.ipxe \ |
323 | ${pkgs.closureInfo { rootPaths = installerBuild.storeContents; }}/registration | 326 | ${pkgs.closureInfo { rootPaths = installerBuild.storeContents; }}/registration |
324 | '')) | 327 | install -m 0444 ${pkgs.writeText "installer-${system}.menu.ipxe" '' |
325 | (pkgs.writeTextFile { | ||
326 | name = "installer-${system}.menu.ipxe"; | ||
327 | destination = "/installer-${system}.menu.ipxe"; | ||
328 | text = '' | ||
329 | #!ipxe | 328 | #!ipxe |
330 | 329 | ||
331 | :start | 330 | :start |
332 | menu iPXE boot menu for installer-${system} | 331 | menu iPXE boot menu for installer-${system} |
333 | item installer installer-${system} | 332 | item installer ${with installerBuild'; "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"} |
334 | item memtest memtest86plus | 333 | item memtest memtest86plus |
335 | item netboot netboot.xyz | 334 | item netboot netboot.xyz |
336 | item shell iPXE shell | 335 | item shell iPXE shell |
@@ -352,8 +351,8 @@ in { | |||
352 | :memtest | 351 | :memtest |
353 | iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin | 352 | iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin |
354 | goto start | 353 | goto start |
355 | ''; | 354 | ''} $out/installer-${system}.menu.ipxe |
356 | }) | 355 | ''))) |
357 | ]; | 356 | ]; |
358 | }) ["x86_64-linux"] | 357 | }) ["x86_64-linux"] |
359 | ) ++ [ | 358 | ) ++ [ |
@@ -365,15 +364,17 @@ in { | |||
365 | install -m 0444 ${sources.netbootxyz-efi.src} $out/netboot.xyz.efi | 364 | install -m 0444 ${sources.netbootxyz-efi.src} $out/netboot.xyz.efi |
366 | install -m 0444 ${sources.netbootxyz-lkrn.src} $out/netboot.xyz.lkrn | 365 | install -m 0444 ${sources.netbootxyz-lkrn.src} $out/netboot.xyz.lkrn |
367 | '') | 366 | '') |
368 | (let | 367 | (builtins.addErrorContext "while evaluating eostre" (let |
369 | eostreBuild = (flake.nixosConfigurations.eostre.extendModules { | 368 | eostreBuild' = (flake.nixosConfigurations.eostre.extendModules { |
370 | modules = [ | 369 | modules = [ |
371 | ({ ... }: { | 370 | ({ ... }: { |
372 | config.nfsroot.storeDevice = "${tftpIp}:nix-store"; | 371 | config.nfsroot.storeDevice = "${nfsIp}:nix-store"; |
373 | config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/eostre/registration"; | 372 | config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/eostre/registration"; |
373 | config.system.nixos.label = "eostre"; | ||
374 | }) | 374 | }) |
375 | ]; | 375 | ]; |
376 | }).config.system.build; | 376 | }); |
377 | eostreBuild = eostreBuild'.config.system.build; | ||
377 | in builtins.toPath (pkgs.runCommandLocal "eostre" {} '' | 378 | in builtins.toPath (pkgs.runCommandLocal "eostre" {} '' |
378 | mkdir -p $out/eostre | 379 | mkdir -p $out/eostre |
379 | install -m 0444 -t $out/eostre \ | 380 | install -m 0444 -t $out/eostre \ |
@@ -381,43 +382,39 @@ in { | |||
381 | ${eostreBuild.kernel}/bzImage \ | 382 | ${eostreBuild.kernel}/bzImage \ |
382 | ${eostreBuild.netbootIpxeScript}/netboot.ipxe \ | 383 | ${eostreBuild.netbootIpxeScript}/netboot.ipxe \ |
383 | ${pkgs.closureInfo { rootPaths = eostreBuild.storeContents; }}/registration | 384 | ${pkgs.closureInfo { rootPaths = eostreBuild.storeContents; }}/registration |
384 | '')) | 385 | install -m 0444 ${pkgs.writeText "eostre.menu.ipxe" '' |
385 | (pkgs.writeTextFile { | 386 | #!ipxe |
386 | name = "eostre.menu.ipxe"; | ||
387 | destination = "/eostre.menu.ipxe"; | ||
388 | text = '' | ||
389 | #!ipxe | ||
390 | 387 | ||
391 | set menu-timeout 5000 | 388 | set menu-timeout 5000 |
392 | 389 | ||
393 | :start | 390 | :start |
394 | menu iPXE boot menu for eostre | 391 | menu iPXE boot menu for eostre |
395 | item eostre eostre | 392 | item eostre ${with eostreBuild'; "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"} |
396 | item memtest memtest86plus | 393 | item memtest memtest86plus |
397 | item netboot netboot.xyz | 394 | item netboot netboot.xyz |
398 | item shell iPXE shell | 395 | item shell iPXE shell |
399 | choose --timeout ''${menu-timeout} --default eostre selected || goto shell | 396 | choose --timeout ''${menu-timeout} --default eostre selected || goto shell |
400 | set menu-timeout 0 | 397 | set menu-timeout 0 |
401 | goto ''${selected} | 398 | goto ''${selected} |
402 | 399 | ||
403 | :shell | 400 | :shell |
404 | set menu-timeout 0 | 401 | set menu-timeout 0 |
405 | shell | 402 | shell |
406 | goto start | 403 | goto start |
407 | 404 | ||
408 | :eostre | 405 | :eostre |
409 | chain eostre/netboot.ipxe | 406 | chain eostre/netboot.ipxe |
410 | goto start | 407 | goto start |
411 | 408 | ||
412 | :netboot | 409 | :netboot |
413 | iseq ''${platform} efi && chain --autofree netboot.xyz.efi || chain --autofree netboot.xyz.lkrn | 410 | iseq ''${platform} efi && chain --autofree netboot.xyz.efi || chain --autofree netboot.xyz.lkrn |
414 | goto start | 411 | goto start |
415 | 412 | ||
416 | :memtest | 413 | :memtest |
417 | iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin | 414 | iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin |
418 | goto start | 415 | goto start |
419 | ''; | 416 | ''} $out/eostre.menu.ipxe |
420 | }) | 417 | ''))) |
421 | ]; | 418 | ]; |
422 | }; | 419 | }; |
423 | }; | 420 | }; |
diff --git a/hosts/vidhar/network/ruleset.nft b/hosts/vidhar/network/ruleset.nft index 1edae167..7897fb3d 100644 --- a/hosts/vidhar/network/ruleset.nft +++ b/hosts/vidhar/network/ruleset.nft | |||
@@ -60,6 +60,7 @@ table inet filter { | |||
60 | counter fw-lo {} | 60 | counter fw-lo {} |
61 | counter fw-lan {} | 61 | counter fw-lan {} |
62 | counter fw-gpon {} | 62 | counter fw-gpon {} |
63 | counter fw-kimai {} | ||
63 | 64 | ||
64 | counter fw-cups {} | 65 | counter fw-cups {} |
65 | 66 | ||
@@ -94,6 +95,8 @@ table inet filter { | |||
94 | counter immich-rx {} | 95 | counter immich-rx {} |
95 | counter paperless-rx {} | 96 | counter paperless-rx {} |
96 | counter hledger-rx {} | 97 | counter hledger-rx {} |
98 | counter audiobookshelf-rx {} | ||
99 | counter kimai-rx {} | ||
97 | 100 | ||
98 | counter established-rx {} | 101 | counter established-rx {} |
99 | 102 | ||
@@ -125,6 +128,8 @@ table inet filter { | |||
125 | counter immich-tx {} | 128 | counter immich-tx {} |
126 | counter paperless-tx {} | 129 | counter paperless-tx {} |
127 | counter hledger-tx {} | 130 | counter hledger-tx {} |
131 | counter audiobookshelf-tx {} | ||
132 | counter kimai-tx {} | ||
128 | 133 | ||
129 | counter tx {} | 134 | counter tx {} |
130 | 135 | ||
@@ -148,8 +153,13 @@ table inet filter { | |||
148 | 153 | ||
149 | oifname { lan, gpon, bifrost } meta l4proto $icmp_protos jump forward_icmp_accept | 154 | oifname { lan, gpon, bifrost } meta l4proto $icmp_protos jump forward_icmp_accept |
150 | iifname lan oifname { gpon, bifrost } counter name fw-lan accept | 155 | iifname lan oifname { gpon, bifrost } counter name fw-lan accept |
156 | iifname ve-kimai oifname gpon counter name fw-kimai accept | ||
151 | 157 | ||
152 | iifname gpon oifname lan ct state { established, related } counter name fw-gpon accept | 158 | iifname gpon oifname lan ct state { established, related } counter name fw-gpon accept |
159 | iifname gpon oifname ve-kimai ct state { established, related } counter name fw-kimai accept | ||
160 | |||
161 | iifname bifrost oifname ve-kimai tcp dport 80 ip6 saddr $bifrost_surtr ip6 daddr 2a03:4000:52:ada:6::2 counter name kimai-rx accept | ||
162 | iifname ve-kimai oifname bifrost tcp sport 80 ip6 saddr 2a03:4000:52:ada:6::2 ip6 daddr $bifrost_surtr counter name kimai-tx accept | ||
153 | 163 | ||
154 | 164 | ||
155 | limit name lim_reject log level debug prefix "drop forward: " counter name reject-ratelimit-fw drop | 165 | limit name lim_reject log level debug prefix "drop forward: " counter name reject-ratelimit-fw drop |
@@ -203,6 +213,7 @@ table inet filter { | |||
203 | iifname bifrost tcp dport 2283 ip6 saddr $bifrost_surtr counter name immich-rx accept | 213 | iifname bifrost tcp dport 2283 ip6 saddr $bifrost_surtr counter name immich-rx accept |
204 | iifname bifrost tcp dport 28981 ip6 saddr $bifrost_surtr counter name paperless-rx accept | 214 | iifname bifrost tcp dport 28981 ip6 saddr $bifrost_surtr counter name paperless-rx accept |
205 | iifname bifrost tcp dport 5000 ip6 saddr $bifrost_surtr counter name hledger-rx accept | 215 | iifname bifrost tcp dport 5000 ip6 saddr $bifrost_surtr counter name hledger-rx accept |
216 | iifname bifrost tcp dport 28982 ip6 saddr $bifrost_surtr counter name audiobookshelf-rx accept | ||
206 | 217 | ||
207 | ct state { established, related } counter name established-rx accept | 218 | ct state { established, related } counter name established-rx accept |
208 | 219 | ||
@@ -254,6 +265,7 @@ table inet filter { | |||
254 | iifname bifrost tcp sport 2283 ip6 daddr $bifrost_surtr counter name immich-tx accept | 265 | iifname bifrost tcp sport 2283 ip6 daddr $bifrost_surtr counter name immich-tx accept |
255 | iifname bifrost tcp sport 28981 ip6 daddr $bifrost_surtr counter name paperless-tx accept | 266 | iifname bifrost tcp sport 28981 ip6 daddr $bifrost_surtr counter name paperless-tx accept |
256 | iifname bifrost tcp sport 5000 ip6 daddr $bifrost_surtr counter name hledger-tx accept | 267 | iifname bifrost tcp sport 5000 ip6 daddr $bifrost_surtr counter name hledger-tx accept |
268 | iifname bifrost tcp sport 28982 ip6 daddr $bifrost_surtr counter name audiobookshelf-tx accept | ||
257 | 269 | ||
258 | 270 | ||
259 | counter name tx | 271 | counter name tx |
@@ -262,7 +274,7 @@ table inet filter { | |||
262 | 274 | ||
263 | table inet nat { | 275 | table inet nat { |
264 | counter gpon-nat {} | 276 | counter gpon-nat {} |
265 | # counter container-nat {} | 277 | counter kimai-nat {} |
266 | 278 | ||
267 | chain postrouting { | 279 | chain postrouting { |
268 | type nat hook postrouting priority srcnat | 280 | type nat hook postrouting priority srcnat |
@@ -270,7 +282,7 @@ table inet nat { | |||
270 | 282 | ||
271 | 283 | ||
272 | meta nfproto ipv4 oifname gpon counter name gpon-nat masquerade | 284 | meta nfproto ipv4 oifname gpon counter name gpon-nat masquerade |
273 | # iifname ve-* oifname gpon counter name container-nat masquerade | 285 | iifname ve-kimai oifname gpon counter name kimai-nat masquerade |
274 | } | 286 | } |
275 | } | 287 | } |
276 | 288 | ||
diff --git a/hosts/vidhar/paperless/default.nix b/hosts/vidhar/paperless/default.nix index 34cd18c4..dd02da38 100644 --- a/hosts/vidhar/paperless/default.nix +++ b/hosts/vidhar/paperless/default.nix | |||
@@ -4,7 +4,7 @@ | |||
4 | config = { | 4 | config = { |
5 | services.paperless = { | 5 | services.paperless = { |
6 | enable = true; | 6 | enable = true; |
7 | address = "[2a03:4000:52:ada:4:1::]"; | 7 | address = "2a03:4000:52:ada:4:1::"; |
8 | passwordFile = config.sops.secrets."paperless-rootpw".path; | 8 | passwordFile = config.sops.secrets."paperless-rootpw".path; |
9 | settings = { | 9 | settings = { |
10 | PAPERLESS_OCR_LANGUAGE = "deu+eng"; | 10 | PAPERLESS_OCR_LANGUAGE = "deu+eng"; |
diff --git a/hosts/vidhar/prometheus/default.nix b/hosts/vidhar/prometheus/default.nix index d368ad52..094f9f7a 100644 --- a/hosts/vidhar/prometheus/default.nix +++ b/hosts/vidhar/prometheus/default.nix | |||
@@ -26,7 +26,8 @@ in { | |||
26 | enable = true; | 26 | enable = true; |
27 | 27 | ||
28 | extraFlags = [ | 28 | extraFlags = [ |
29 | "--enable-feature=remote-write-receiver" | 29 | "--web.enable-remote-write-receiver" |
30 | "--storage.tsdb.retention.size=35GB" | ||
30 | ]; | 31 | ]; |
31 | 32 | ||
32 | exporters = { | 33 | exporters = { |