summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_sources/generated.json16
-rw-r--r--_sources/generated.nix16
-rw-r--r--flake.lock50
-rw-r--r--hosts/vidhar/network/pppoe.nix165
-rw-r--r--hosts/vidhar/prometheus/default.nix2
-rw-r--r--overlays/spm/default.nix3
-rw-r--r--overlays/spm/lib/Spm/Api.hs19
-rw-r--r--overlays/spm/server/Spm/Server.hs7
-rw-r--r--overlays/spm/server/Spm/Server/Ctx.hs3
-rw-r--r--overlays/spm/server/Spm/Server/Database.hs9
10 files changed, 161 insertions, 129 deletions
diff --git a/_sources/generated.json b/_sources/generated.json
index 9eb52238..f5ead269 100644
--- a/_sources/generated.json
+++ b/_sources/generated.json
@@ -273,7 +273,7 @@
273 }, 273 },
274 "nix-output-monitor": { 274 "nix-output-monitor": {
275 "cargoLock": null, 275 "cargoLock": null,
276 "date": "2025-11-09", 276 "date": "2025-11-20",
277 "extract": null, 277 "extract": null,
278 "name": "nix-output-monitor", 278 "name": "nix-output-monitor",
279 "passthru": null, 279 "passthru": null,
@@ -283,13 +283,13 @@
283 "fetchSubmodules": false, 283 "fetchSubmodules": false,
284 "leaveDotGit": false, 284 "leaveDotGit": false,
285 "name": null, 285 "name": null,
286 "rev": "698e6f3afdc9d68dd65d84df7b030499dbfaf84b", 286 "rev": "0cb46615fb8187e4598feac4ccf8f27a06aae0b7",
287 "sha256": "sha256-QwEVaUxvXEdx5icIZZYQQjvJO5j0+GeWtJvCJ/LZwpA=", 287 "sha256": "sha256-iEvbCIlHX6WUblrnoF7gwUQtu2ay97zoZsvoP85I2BA=",
288 "sparseCheckout": [], 288 "sparseCheckout": [],
289 "type": "git", 289 "type": "git",
290 "url": "https://code.maralorn.de/maralorn/nix-output-monitor.git" 290 "url": "https://code.maralorn.de/maralorn/nix-output-monitor.git"
291 }, 291 },
292 "version": "698e6f3afdc9d68dd65d84df7b030499dbfaf84b" 292 "version": "0cb46615fb8187e4598feac4ccf8f27a06aae0b7"
293 }, 293 },
294 "postfix-mta-sts-resolver": { 294 "postfix-mta-sts-resolver": {
295 "cargoLock": null, 295 "cargoLock": null,
@@ -355,7 +355,7 @@
355 }, 355 },
356 "quickshell": { 356 "quickshell": {
357 "cargoLock": null, 357 "cargoLock": null,
358 "date": "2025-10-31", 358 "date": "2025-11-20",
359 "extract": null, 359 "extract": null,
360 "name": "quickshell", 360 "name": "quickshell",
361 "passthru": null, 361 "passthru": null,
@@ -365,13 +365,13 @@
365 "fetchSubmodules": false, 365 "fetchSubmodules": false,
366 "leaveDotGit": false, 366 "leaveDotGit": false,
367 "name": null, 367 "name": null,
368 "rev": "fc704e6b5d445899a1565955268c91942a4f263f", 368 "rev": "ed036d514b0fdbce03158a0b331305be166f4555",
369 "sha256": "sha256-er4gYrIoThYLjlsOMTysoRfn67d1Gci+ZpqDrtQxrA0=", 369 "sha256": "sha256-jWz10RbNAyylJbH4cUTLS/CsDjkd8gxfT8OsIgQIgEg=",
370 "sparseCheckout": [], 370 "sparseCheckout": [],
371 "type": "git", 371 "type": "git",
372 "url": "https://git.outfoxxed.me/quickshell/quickshell.git" 372 "url": "https://git.outfoxxed.me/quickshell/quickshell.git"
373 }, 373 },
374 "version": "fc704e6b5d445899a1565955268c91942a4f263f" 374 "version": "ed036d514b0fdbce03158a0b331305be166f4555"
375 }, 375 },
376 "scutiger": { 376 "scutiger": {
377 "cargoLock": null, 377 "cargoLock": null,
diff --git a/_sources/generated.nix b/_sources/generated.nix
index 14548513..d3d9b36f 100644
--- a/_sources/generated.nix
+++ b/_sources/generated.nix
@@ -171,17 +171,17 @@
171 }; 171 };
172 nix-output-monitor = { 172 nix-output-monitor = {
173 pname = "nix-output-monitor"; 173 pname = "nix-output-monitor";
174 version = "698e6f3afdc9d68dd65d84df7b030499dbfaf84b"; 174 version = "0cb46615fb8187e4598feac4ccf8f27a06aae0b7";
175 src = fetchgit { 175 src = fetchgit {
176 url = "https://code.maralorn.de/maralorn/nix-output-monitor.git"; 176 url = "https://code.maralorn.de/maralorn/nix-output-monitor.git";
177 rev = "698e6f3afdc9d68dd65d84df7b030499dbfaf84b"; 177 rev = "0cb46615fb8187e4598feac4ccf8f27a06aae0b7";
178 fetchSubmodules = false; 178 fetchSubmodules = false;
179 deepClone = false; 179 deepClone = false;
180 leaveDotGit = false; 180 leaveDotGit = false;
181 sparseCheckout = [ ]; 181 sparseCheckout = [ ];
182 sha256 = "sha256-QwEVaUxvXEdx5icIZZYQQjvJO5j0+GeWtJvCJ/LZwpA="; 182 sha256 = "sha256-iEvbCIlHX6WUblrnoF7gwUQtu2ay97zoZsvoP85I2BA=";
183 }; 183 };
184 date = "2025-11-09"; 184 date = "2025-11-20";
185 }; 185 };
186 postfix-mta-sts-resolver = { 186 postfix-mta-sts-resolver = {
187 pname = "postfix-mta-sts-resolver"; 187 pname = "postfix-mta-sts-resolver";
@@ -223,17 +223,17 @@
223 }; 223 };
224 quickshell = { 224 quickshell = {
225 pname = "quickshell"; 225 pname = "quickshell";
226 version = "fc704e6b5d445899a1565955268c91942a4f263f"; 226 version = "ed036d514b0fdbce03158a0b331305be166f4555";
227 src = fetchgit { 227 src = fetchgit {
228 url = "https://git.outfoxxed.me/quickshell/quickshell.git"; 228 url = "https://git.outfoxxed.me/quickshell/quickshell.git";
229 rev = "fc704e6b5d445899a1565955268c91942a4f263f"; 229 rev = "ed036d514b0fdbce03158a0b331305be166f4555";
230 fetchSubmodules = false; 230 fetchSubmodules = false;
231 deepClone = false; 231 deepClone = false;
232 leaveDotGit = false; 232 leaveDotGit = false;
233 sparseCheckout = [ ]; 233 sparseCheckout = [ ];
234 sha256 = "sha256-er4gYrIoThYLjlsOMTysoRfn67d1Gci+ZpqDrtQxrA0="; 234 sha256 = "sha256-jWz10RbNAyylJbH4cUTLS/CsDjkd8gxfT8OsIgQIgEg=";
235 }; 235 };
236 date = "2025-10-31"; 236 date = "2025-11-20";
237 }; 237 };
238 scutiger = { 238 scutiger = {
239 pname = "scutiger"; 239 pname = "scutiger";
diff --git a/flake.lock b/flake.lock
index 71b66525..bb3f952a 100644
--- a/flake.lock
+++ b/flake.lock
@@ -264,11 +264,11 @@
264 "flake-registry": { 264 "flake-registry": {
265 "flake": false, 265 "flake": false,
266 "locked": { 266 "locked": {
267 "lastModified": 1744623129, 267 "lastModified": 1763556067,
268 "narHash": "sha256-nlQTQrHqM+ywXN0evDXnYEV6z6WWZB5BFQ2TkXsduKw=", 268 "narHash": "sha256-q2jzJQdsJMpD3dbuNphQJgwx6XeGPonWOp43U0nY7o0=",
269 "owner": "NixOS", 269 "owner": "NixOS",
270 "repo": "flake-registry", 270 "repo": "flake-registry",
271 "rev": "1322f33d5836ae757d2e6190239252cf8402acf6", 271 "rev": "cb70c9306b44501de412649c356dee503a25f119",
272 "type": "github" 272 "type": "github"
273 }, 273 },
274 "original": { 274 "original": {
@@ -507,11 +507,11 @@
507 "xwayland-satellite-unstable": "xwayland-satellite-unstable" 507 "xwayland-satellite-unstable": "xwayland-satellite-unstable"
508 }, 508 },
509 "locked": { 509 "locked": {
510 "lastModified": 1762886612, 510 "lastModified": 1763581369,
511 "narHash": "sha256-gaPe/qkI4C9KyT8IZMvS9rXCWn2klxCC+MjXFU+jvqk=", 511 "narHash": "sha256-HTLoe4UvnG5fWruO+zjnZJNCnKcbVM8eeSPpIlKHOyI=",
512 "owner": "sodiboo", 512 "owner": "sodiboo",
513 "repo": "niri-flake", 513 "repo": "niri-flake",
514 "rev": "4efef728e910bb8f009fa2db143baeacaa3466ec", 514 "rev": "ca75677ad47613f6afbbc2c6142601fef0ac7631",
515 "type": "github" 515 "type": "github"
516 }, 516 },
517 "original": { 517 "original": {
@@ -583,11 +583,11 @@
583 ] 583 ]
584 }, 584 },
585 "locked": { 585 "locked": {
586 "lastModified": 1762660502, 586 "lastModified": 1763265660,
587 "narHash": "sha256-C9F1C31ys0V7mnp4EcDy7L1cLZw/sCTEXqqTtGnvu08=", 587 "narHash": "sha256-Ad9Rd3ZAidrH01xP73S3CjPiyXo7ywZs3uCESjPwUdc=",
588 "owner": "Mic92", 588 "owner": "Mic92",
589 "repo": "nix-index-database", 589 "repo": "nix-index-database",
590 "rev": "15c5451c63f4c612874a43846bfe3fa828b03eee", 590 "rev": "469ef53571ea80890c9497952787920c79c1ee6e",
591 "type": "github" 591 "type": "github"
592 }, 592 },
593 "original": { 593 "original": {
@@ -765,11 +765,11 @@
765 }, 765 },
766 "nixpkgs-stable_2": { 766 "nixpkgs-stable_2": {
767 "locked": { 767 "locked": {
768 "lastModified": 1762756533, 768 "lastModified": 1763334038,
769 "narHash": "sha256-HiRDeUOD1VLklHeOmaKDzf+8Hb7vSWPVFcWwaTrpm+U=", 769 "narHash": "sha256-LBVOyaH6NFzQ3X/c6vfMZ9k4SV2ofhpxeL9YnhHNJQQ=",
770 "owner": "NixOS", 770 "owner": "NixOS",
771 "repo": "nixpkgs", 771 "repo": "nixpkgs",
772 "rev": "c2448301fb856e351aab33e64c33a3fc8bcf637d", 772 "rev": "4c8cdd5b1a630e8f72c9dd9bf582b1afb3127d2c",
773 "type": "github" 773 "type": "github"
774 }, 774 },
775 "original": { 775 "original": {
@@ -813,11 +813,11 @@
813 }, 813 },
814 "nixpkgs_2": { 814 "nixpkgs_2": {
815 "locked": { 815 "locked": {
816 "lastModified": 1762981181, 816 "lastModified": 1763421233,
817 "narHash": "sha256-tnAS+voD6T221j4u7ldRrM3WwQtVVmwC3TYRkubdeKI=", 817 "narHash": "sha256-Stk9ZYRkGrnnpyJ4eqt9eQtdFWRRIvMxpNRf4sIegnw=",
818 "owner": "gkleen", 818 "owner": "NixOS",
819 "repo": "nixpkgs", 819 "repo": "nixpkgs",
820 "rev": "258ffe798997c648dcc04a784166c4e1a3bdd68e", 820 "rev": "89c2b2330e733d6cdb5eae7b899326930c2c0648",
821 "type": "github" 821 "type": "github"
822 }, 822 },
823 "original": { 823 "original": {
@@ -1077,11 +1077,11 @@
1077 ] 1077 ]
1078 }, 1078 },
1079 "locked": { 1079 "locked": {
1080 "lastModified": 1762427963, 1080 "lastModified": 1763435975,
1081 "narHash": "sha256-CkPlAbIQ87wmjy5qHibfzk4DmMGBNqFer+lLfXjpP5M=", 1081 "narHash": "sha256-SKdpcVuJKMNEXloIpLXY+jDI42+6Ew21vdkl894DxHo=",
1082 "owner": "pyproject-nix", 1082 "owner": "pyproject-nix",
1083 "repo": "pyproject.nix", 1083 "repo": "pyproject.nix",
1084 "rev": "4540ea004e04fcd12dd2738d51383d10f956f7b9", 1084 "rev": "7d3d8848358ccbd415afe2139f12b9e1508d3ace",
1085 "type": "github" 1085 "type": "github"
1086 }, 1086 },
1087 "original": { 1087 "original": {
@@ -1149,11 +1149,11 @@
1149 ] 1149 ]
1150 }, 1150 },
1151 "locked": { 1151 "locked": {
1152 "lastModified": 1762812535, 1152 "lastModified": 1763607916,
1153 "narHash": "sha256-A91a+K0Q9wfdPLwL06e/kbHeAWSzPYy2EGdTDsyfb+s=", 1153 "narHash": "sha256-VefBA1JWRXM929mBAFohFUtQJLUnEwZ2vmYUNkFnSjE=",
1154 "owner": "Mic92", 1154 "owner": "Mic92",
1155 "repo": "sops-nix", 1155 "repo": "sops-nix",
1156 "rev": "d75e4f89e58fdda39e4809f8c52013caa22483b7", 1156 "rev": "877bb495a6f8faf0d89fc10bd142c4b7ed2bcc0b",
1157 "type": "github" 1157 "type": "github"
1158 }, 1158 },
1159 "original": { 1159 "original": {
@@ -1224,11 +1224,11 @@
1224 ] 1224 ]
1225 }, 1225 },
1226 "locked": { 1226 "locked": {
1227 "lastModified": 1762859175, 1227 "lastModified": 1763421857,
1228 "narHash": "sha256-R4lx2xW4NuIU/+YvF4hNb/Fw6xIImlmm+6S1QB+Jh+k=", 1228 "narHash": "sha256-8JurcmEzAkrpm+eUDm8W/+KkU/w/viAeyJhJlIX2qOQ=",
1229 "owner": "pyproject-nix", 1229 "owner": "pyproject-nix",
1230 "repo": "uv2nix", 1230 "repo": "uv2nix",
1231 "rev": "41816ac37553af248bb29624885c471f5ae2b835", 1231 "rev": "c9752c6c5915eece99505612d8f7805185cff990",
1232 "type": "github" 1232 "type": "github"
1233 }, 1233 },
1234 "original": { 1234 "original": {
diff --git a/hosts/vidhar/network/pppoe.nix b/hosts/vidhar/network/pppoe.nix
index 5cc84862..d17be349 100644
--- a/hosts/vidhar/network/pppoe.nix
+++ b/hosts/vidhar/network/pppoe.nix
@@ -4,6 +4,48 @@ with lib;
4 4
5let 5let
6 pppInterface = config.networking.pppInterface; 6 pppInterface = config.networking.pppInterface;
7
8 corerad-deprecated = pkgs.writers.writeBashBin "corerad-deprecated" ''
9 exec -- ${lib.getExe' config.systemd.package "systemd-run"} \
10 --unit=corerad-deprecated@$(${lib.getExe' config.systemd.package "systemd-escape"} $1) \
11 --property=AmbientCapabilities="CAP_NET_ADMIN CAP_NET_RAW" \
12 --property=CapabilityBoundingSet="CAP_NET_ADMIN CAP_NET_RAW" \
13 --property=DynamicUser=yes \
14 --property=LimitNOFILE=1048576 \
15 --property=LimitNPROC=512 \
16 --property=NotifyAccess=main \
17 --property=Type=notify \
18 --property=RuntimeMaxSec=4h \
19 ${pkgs.writers.writeBash "corerad-deprecated" ''
20 exec -- ${lib.getExe pkgs.corerad} -c=<(${pkgs.writers.writePython3 "corerad-config" {
21 libraries = with pkgs.python3Packages; [ toml ];
22 flakeIgnore = [ "E124" "E121" ];
23 } ''
24 import toml
25 import sys
26 import re
27
28 match = re.fullmatch(r'(?P<interface>[^/]+)/(?P<prefix>.+)', sys.argv[1])
29
30 toml.dump({
31 "interfaces": [
32 {
33 "name": match.group("interface"),
34 "advertise": True,
35 "prefix": [
36 {
37 "prefix": match.group("prefix"),
38 "preferred_lifetime": "1s",
39 "valid_lifetime": "14400s",
40 "deprecated": True,
41 },
42 ],
43 },
44 ],
45 }, sys.stdout)
46 ''} $@)
47 ''} $@
48 '';
7in { 49in {
8 options = { 50 options = {
9 networking.pppInterface = mkOption { 51 networking.pppInterface = mkOption {
@@ -131,6 +173,8 @@ in {
131 }; 173 };
132 }; 174 };
133 }; 175 };
176 environment.systemPackages = [ corerad-deprecated ];
177
134 services.ndppd = { 178 services.ndppd = {
135 enable = true; 179 enable = true;
136 proxies = { 180 proxies = {
@@ -160,75 +204,69 @@ in {
160 bindsTo = [ "sys-subsystem-net-devices-telekom.device" ]; 204 bindsTo = [ "sys-subsystem-net-devices-telekom.device" ];
161 after = [ "sys-subsystem-net-devices-telekom.device" ]; 205 after = [ "sys-subsystem-net-devices-telekom.device" ];
162 }; 206 };
163 systemd.services."dhcpcd-${pppInterface}" = {
164 wantedBy = [ "multi-user.target" "network-online.target" "pppd-telekom.service" ];
165 bindsTo = [ "pppd-telekom.service" ];
166 after = [ "pppd-telekom.service" ];
167 wants = [ "network.target" ];
168 before = [ "network-online.target" ];
169 207
170 path = with pkgs; [ dhcpcd nettools openresolv ]; 208 networking.interfaces.${pppInterface}.useDHCP = true;
171 unitConfig.ConditionCapability = "CAP_NET_ADMIN"; 209 networking.dhcpcd = {
172 210 enable = true;
173 stopIfChanged = true; 211 persistent = false;
212 setHostname = false;
213 wait = "ipv6";
214 IPv6rs = false;
174 215
175 preStart = '' 216 extraConfig = ''
176 i=0 217 duid
218 vendorclassid
219 ipv6only
177 220
178 while [[ -z "$(${pkgs.iproute2}/bin/ip -6 addr show dev ${pppInterface} scope link)" ]]; do 221 require dhcp_server_identifier
179 ${pkgs.coreutils}/bin/sleep 0.1
180 i=$((i + 1))
181 if [[ "$i" -ge 10 ]]; then
182 exit 1
183 fi
184 done
185 '';
186 222
187 postStop = '' 223 reboot 0
188 for dev in lan; do
189 ${pkgs.iproute2}/bin/ip -6 a show dev "''${dev}" scope global | ${pkgs.gnugrep}/bin/grep inet6 | ${pkgs.gawk}/bin/awk '{ print $2; }' | ${pkgs.findutils}/bin/xargs -I '{}' -- ${pkgs.iproute2}/bin/ip addr del '{}' dev "''${dev}"
190 done
191 '';
192 224
193 serviceConfig = let 225 interface ${pppInterface}
194 dhcpcdConf = pkgs.writeText "dhcpcd.conf" '' 226 nooption domain_name_servers, domain_name, domain_search, ntp_servers
195 duid 227 nohook hostname, resolv.conf
196 vendorclassid 228 option rapid_commit
197 ipv6only
198 229
199 nooption domain_name_servers, domain_name, domain_search 230 ipv6rs
200 option classless_static_routes
201 option interface_mtu
202 231
203 option host_name 232 ia_pd 1 lan/0/64/0
204 option rapid_commit 233 '';
205 require dhcp_server_identifier 234 };
206 slaac private 235 systemd.services.dhcpcd = {
236 wantedBy = [ "multi-user.target" "network-online.target" "pppd-telekom.service" ];
237 bindsTo = [ "pppd-telekom.service" ];
238 after = [ "pppd-telekom.service" ];
239 wants = [ "network.target" ];
240 before = [ "network-online.target" ];
207 241
208 nohook resolv.conf 242 serviceConfig = {
209 ipv6ra_autoconf 243 ExecStartPre = [
210 iaid 1195061668 244 (pkgs.resholve.writeScript "wait-${pppInterface}-ip" {
211 ipv6rs # enable routing solicitation for WAN adapter 245 interpreter = pkgs.runtimeShell;
212 ia_pd 1 lan/0/64/0 # request a PD and assign it to the LAN 246 inputs = with pkgs; [ iproute2 coreutils ];
247 execer = [
248 "cannot:${lib.getExe' pkgs.iproute2 "ip"}"
249 ];
250 } ''
251 i=0
213 252
214 reboot 0 253 while [[ -z "$(ip -6 addr show dev ${pppInterface} scope link)" ]]; do
254 sleep 0.1
255 i=$((i + 1))
256 if [[ "$i" -ge 10 ]]; then
257 exit 1
258 fi
259 done
260 '')
261 ];
215 262
216 waitip 6
217 '';
218 in {
219 Type = "forking";
220 PIDFile = "/var/run/dhcpcd/${pppInterface}.pid";
221 RuntimeDirectory = "dhcpcd";
222 ExecStart = "@${pkgs.dhcpcd}/sbin/dhcpcd dhcpcd -q --config ${dhcpcdConf} ${pppInterface}";
223 ExecReload = "${pkgs.dhcpcd}/sbin/dhcpcd --rebind ${pppInterface}";
224 Restart = "always";
225 RestartSec = "5"; 263 RestartSec = "5";
226 }; 264 };
227 }; 265 };
228 systemd.services.ndppd = { 266 systemd.services.ndppd = {
229 wantedBy = [ "dhcpcd-${pppInterface}.service" ]; 267 wantedBy = [ "dhcpcd.service" ];
230 bindsTo = [ "dhcpcd-${pppInterface}.service" ]; 268 bindsTo = [ "dhcpcd.service" ];
231 after = [ "dhcpcd-${pppInterface}.service" ]; 269 after = [ "dhcpcd.service" ];
232 270
233 serviceConfig = { 271 serviceConfig = {
234 Restart = "always"; 272 Restart = "always";
@@ -236,25 +274,20 @@ in {
236 }; 274 };
237 }; 275 };
238 systemd.services.corerad = { 276 systemd.services.corerad = {
239 wantedBy = [ "dhcpcd-${pppInterface}.service" ]; 277 wantedBy = [ "dhcpcd.service" ];
240 bindsTo = [ "dhcpcd-${pppInterface}.service" ]; 278 bindsTo = [ "dhcpcd.service" ];
241 after = [ "dhcpcd-${pppInterface}.service" ]; 279 after = [ "dhcpcd.service" ];
242 280
243 serviceConfig = { 281 serviceConfig = {
244 Restart = lib.mkForce "always"; 282 Restart = lib.mkForce "always";
245 RestartSec = "5"; 283 RestartSec = "5";
246 }; 284 };
247 }; 285 };
248 users.users.dhcpcd = {
249 isSystemUser = true;
250 group = "dhcpcd";
251 };
252 users.groups.dhcpcd = {};
253 286
254 systemd.services.unbound = { 287 systemd.services.unbound = {
255 wantedBy = [ "dhcpcd-${pppInterface}.service" ]; 288 wantedBy = [ "dhcpcd.service" ];
256 bindsTo = [ "dhcpcd-${pppInterface}.service" ]; 289 bindsTo = [ "dhcpcd.service" ];
257 after = [ "dhcpcd-${pppInterface}.service" ]; 290 after = [ "dhcpcd.service" ];
258 291
259 serviceConfig = { 292 serviceConfig = {
260 Restart = lib.mkForce "always"; 293 Restart = lib.mkForce "always";
diff --git a/hosts/vidhar/prometheus/default.nix b/hosts/vidhar/prometheus/default.nix
index df135b58..125fd568 100644
--- a/hosts/vidhar/prometheus/default.nix
+++ b/hosts/vidhar/prometheus/default.nix
@@ -64,7 +64,7 @@ in {
64 systemd = { 64 systemd = {
65 enable = true; 65 enable = true;
66 extraFlags = [ 66 extraFlags = [
67 "--systemd.collector.unit-include=(dhcpcd-.*|pppd-telekom|corerad|ndppd)\.service" 67 "--systemd.collector.unit-include=(dhcpcd|pppd-telekom|corerad|ndppd)\.service"
68 "--systemd.collector.enable-restart-count" 68 "--systemd.collector.enable-restart-count"
69 "--systemd.collector.enable-ip-accounting" 69 "--systemd.collector.enable-ip-accounting"
70 ]; 70 ];
diff --git a/overlays/spm/default.nix b/overlays/spm/default.nix
index ff135279..bd81ef82 100644
--- a/overlays/spm/default.nix
+++ b/overlays/spm/default.nix
@@ -4,10 +4,11 @@ let
4 # defaultPackages = (import ./stackage.nix {}); 4 # defaultPackages = (import ./stackage.nix {});
5 # haskellPackages = defaultPackages // argumentPackages; 5 # haskellPackages = defaultPackages // argumentPackages;
6 # haskellPackages = argumentPackages; 6 # haskellPackages = argumentPackages;
7 haskellPackages = final.haskell.packages.ghc96.override { 7 haskellPackages = final.haskell.packages.ghc912.override {
8 overrides = self: super: { 8 overrides = self: super: {
9 warp-systemd = final.haskell.lib.doJailbreak (super.warp-systemd.overrideAttrs (oldAttrs: { meta = oldAttrs.meta // { broken = false; }; })); 9 warp-systemd = final.haskell.lib.doJailbreak (super.warp-systemd.overrideAttrs (oldAttrs: { meta = oldAttrs.meta // { broken = false; }; }));
10 unliftio-pool = final.haskell.lib.doJailbreak super.unliftio-pool; 10 unliftio-pool = final.haskell.lib.doJailbreak super.unliftio-pool;
11 cryptonite = super.cryptonite.overrideAttrs (oldAttrs: { doCheck = false; });
11 # servant-server = super.servant-server.overrideAttrs (oldAttrs: { 12 # servant-server = super.servant-server.overrideAttrs (oldAttrs: {
12 # patches = []; 13 # patches = [];
13 # }); 14 # });
diff --git a/overlays/spm/lib/Spm/Api.hs b/overlays/spm/lib/Spm/Api.hs
index 8285cc55..3c22bfb6 100644
--- a/overlays/spm/lib/Spm/Api.hs
+++ b/overlays/spm/lib/Spm/Api.hs
@@ -21,7 +21,6 @@ import Data.Text (Text)
21import qualified Data.Text as Text 21import qualified Data.Text as Text
22 22
23import GHC.Generics (Generic) 23import GHC.Generics (Generic)
24import Type.Reflection (Typeable)
25 24
26import Control.Lens 25import Control.Lens
27 26
@@ -62,7 +61,7 @@ instance FromHttpApiData SpmStyle where
62 61
63 62
64newtype SpmMailbox = SpmMailbox { unSpmMailbox :: CI Text } 63newtype SpmMailbox = SpmMailbox { unSpmMailbox :: CI Text }
65 deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 64 deriving stock (Eq, Ord, Read, Show, Generic)
66 deriving newtype (MimeRender PlainText) 65 deriving newtype (MimeRender PlainText)
67makeWrapped ''SpmMailbox 66makeWrapped ''SpmMailbox
68 67
@@ -70,7 +69,7 @@ instance MimeRender JSON SpmMailbox where
70 mimeRender p mbox = mimeRender p $ JSON.object [ "mailbox" JSON..= unSpmMailbox mbox ] 69 mimeRender p mbox = mimeRender p $ JSON.object [ "mailbox" JSON..= unSpmMailbox mbox ]
71 70
72newtype SpmDomain = SpmDomain { unSpmDomain :: CI Text } 71newtype SpmDomain = SpmDomain { unSpmDomain :: CI Text }
73 deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 72 deriving stock (Eq, Ord, Read, Show, Generic)
74 deriving newtype (MimeRender PlainText) 73 deriving newtype (MimeRender PlainText)
75makeWrapped ''SpmDomain 74makeWrapped ''SpmDomain
76 75
@@ -79,17 +78,17 @@ instance MimeRender JSON SpmDomain where
79 78
80newtype SpmLocal = SpmLocal 79newtype SpmLocal = SpmLocal
81 { unSpmLocal :: CI Text 80 { unSpmLocal :: CI Text
82 } deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 81 } deriving stock (Eq, Ord, Read, Show, Generic)
83 deriving newtype (ToJSON, FromJSON) 82 deriving newtype (ToJSON, FromJSON)
84makeWrapped ''SpmLocal 83makeWrapped ''SpmLocal
85newtype SpmExtension = SpmExtension 84newtype SpmExtension = SpmExtension
86 { unSpmExtension :: CI Text 85 { unSpmExtension :: CI Text
87 } deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 86 } deriving stock (Eq, Ord, Read, Show, Generic)
88 deriving newtype (ToJSON, FromJSON) 87 deriving newtype (ToJSON, FromJSON)
89makeWrapped ''SpmExtension 88makeWrapped ''SpmExtension
90 89
91data SpmMappingState = Valid | Reject 90data SpmMappingState = Valid | Reject
92 deriving (Eq, Ord, Read, Show, Enum, Bounded, Generic, Typeable) 91 deriving (Eq, Ord, Read, Show, Enum, Bounded, Generic)
93instance MimeRender PlainText SpmMappingState where 92instance MimeRender PlainText SpmMappingState where
94 mimeRender p = mimeRender @_ @Text p . \case 93 mimeRender p = mimeRender @_ @Text p . \case
95 Valid -> "valid" 94 Valid -> "valid"
@@ -109,15 +108,15 @@ _SpmMappingStateReject = iso toReject fromReject
109data SpmMappingListingItem = SpmMappingListingItem 108data SpmMappingListingItem = SpmMappingListingItem
110 { smlMapping :: SpmMapping 109 { smlMapping :: SpmMapping
111 , smlState :: SpmMappingState 110 , smlState :: SpmMappingState
112 } deriving (Eq, Ord, Read, Show, Generic, Typeable) 111 } deriving (Eq, Ord, Read, Show, Generic)
113 112
114newtype SpmMappingListing = SpmMappingListing { unSpmMappingListing :: [SpmMappingListingItem] } 113newtype SpmMappingListing = SpmMappingListing { unSpmMappingListing :: [SpmMappingListingItem] }
115 deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 114 deriving stock (Eq, Ord, Read, Show, Generic)
116 115
117data SpmMapping = SpmMapping 116data SpmMapping = SpmMapping
118 { spmMappingLocal :: Maybe SpmLocal 117 { spmMappingLocal :: Maybe SpmLocal
119 , spmMappingExtension :: Maybe SpmExtension 118 , spmMappingExtension :: Maybe SpmExtension
120 } deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 119 } deriving stock (Eq, Ord, Read, Show, Generic)
121 120
122_SpmMappingText :: Iso' SpmMapping Text 121_SpmMappingText :: Iso' SpmMapping Text
123_SpmMappingText = iso toText fromText 122_SpmMappingText = iso toText fromText
@@ -170,7 +169,7 @@ instance ToJSON SpmMappingListing where
170data SpmJWTClaims = SpmJWTClaims 169data SpmJWTClaims = SpmJWTClaims
171 { spmjwtStdClaims :: ClaimsSet 170 { spmjwtStdClaims :: ClaimsSet
172 , spmjwtLocal :: SpmLocal 171 , spmjwtLocal :: SpmLocal
173 } deriving stock (Eq, Show, Generic, Typeable) 172 } deriving stock (Eq, Show, Generic)
174 173
175makeLensesFor [("spmjwtStdClaims", "_stdClaims"), ("spmjwtLocal", "_spmjwtLocal")] ''SpmJWTClaims 174makeLensesFor [("spmjwtStdClaims", "_stdClaims"), ("spmjwtLocal", "_spmjwtLocal")] ''SpmJWTClaims
176 175
diff --git a/overlays/spm/server/Spm/Server.hs b/overlays/spm/server/Spm/Server.hs
index 8e7f8786..dc334729 100644
--- a/overlays/spm/server/Spm/Server.hs
+++ b/overlays/spm/server/Spm/Server.hs
@@ -1,3 +1,5 @@
1{-# OPTIONS_GHC -Wno-orphans #-}
2
1{-# LANGUAGE OverloadedStrings #-} 3{-# LANGUAGE OverloadedStrings #-}
2 4
3module Spm.Server 5module Spm.Server
@@ -24,7 +26,6 @@ import Data.Attoparsec.Text
24import qualified Data.ByteString.Lazy as LBS 26import qualified Data.ByteString.Lazy as LBS
25 27
26import GHC.Generics (Generic) 28import GHC.Generics (Generic)
27import Type.Reflection (Typeable)
28 29
29import Control.Applicative 30import Control.Applicative
30import Control.Monad 31import Control.Monad
@@ -101,7 +102,7 @@ hSslClientSDn = "SSL-Client-S-DN"
101data SSLClientVerify 102data SSLClientVerify
102 = SSLClientVerifySuccess 103 = SSLClientVerifySuccess
103 | SSLClientVerifyOther Text 104 | SSLClientVerifyOther Text
104 deriving (Eq, Ord, Read, Show, Generic, Typeable) 105 deriving (Eq, Ord, Read, Show, Generic)
105instance FromHttpApiData SSLClientVerify where 106instance FromHttpApiData SSLClientVerify where
106 parseUrlPiece = (left Text.pack .) . parseOnly $ p <* endOfInput 107 parseUrlPiece = (left Text.pack .) . parseOnly $ p <* endOfInput
107 where 108 where
@@ -163,7 +164,7 @@ data ServerCtxError
163 | ServerCtxNoCredentialsDirectory 164 | ServerCtxNoCredentialsDirectory
164 | ServerCtxJwkSetDecodeError String 165 | ServerCtxJwkSetDecodeError String
165 | ServerCtxJwkSetEmpty 166 | ServerCtxJwkSetEmpty
166 deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 167 deriving stock (Eq, Ord, Read, Show, Generic)
167 deriving anyclass (Exception) 168 deriving anyclass (Exception)
168 169
169mkSpmApp :: (MonadUnliftIO m, MonadThrow m) => m Application 170mkSpmApp :: (MonadUnliftIO m, MonadThrow m) => m Application
diff --git a/overlays/spm/server/Spm/Server/Ctx.hs b/overlays/spm/server/Spm/Server/Ctx.hs
index 18452a0a..1d228043 100644
--- a/overlays/spm/server/Spm/Server/Ctx.hs
+++ b/overlays/spm/server/Spm/Server/Ctx.hs
@@ -11,7 +11,6 @@ import Database.Persist.Postgresql
11import UnliftIO.Pool 11import UnliftIO.Pool
12import Control.Lens.TH 12import Control.Lens.TH
13 13
14import Type.Reflection (Typeable)
15import GHC.Generics (Generic) 14import GHC.Generics (Generic)
16 15
17 16
@@ -19,6 +18,6 @@ data ServerCtx = ServerCtx
19 { _sctxSqlPool :: Pool SqlBackend 18 { _sctxSqlPool :: Pool SqlBackend
20 , _sctxInstanceId :: UUID 19 , _sctxInstanceId :: UUID
21 , _sctxJwkSet :: JWKSet 20 , _sctxJwkSet :: JWKSet
22 } deriving (Generic, Typeable) 21 } deriving (Generic)
23makeLenses ''ServerCtx 22makeLenses ''ServerCtx
24 23
diff --git a/overlays/spm/server/Spm/Server/Database.hs b/overlays/spm/server/Spm/Server/Database.hs
index 3156e920..4405452f 100644
--- a/overlays/spm/server/Spm/Server/Database.hs
+++ b/overlays/spm/server/Spm/Server/Database.hs
@@ -13,7 +13,6 @@ import Database.Persist.Sql
13import Database.Persist.TH 13import Database.Persist.TH
14 14
15import GHC.Generics (Generic) 15import GHC.Generics (Generic)
16import Type.Reflection (Typeable)
17 16
18import Data.Text (Text) 17import Data.Text (Text)
19 18
@@ -33,22 +32,22 @@ import Web.HttpApiData
33 32
34newtype MailMailbox = MailMailbox 33newtype MailMailbox = MailMailbox
35 { unMailMailbox :: CI Text 34 { unMailMailbox :: CI Text
36 } deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 35 } deriving stock (Eq, Ord, Read, Show, Generic)
37 deriving newtype (PersistField, PersistFieldSql) 36 deriving newtype (PersistField, PersistFieldSql)
38makeWrapped ''MailMailbox 37makeWrapped ''MailMailbox
39newtype MailLocal = MailLocal 38newtype MailLocal = MailLocal
40 { unMailLocal :: CI Text 39 { unMailLocal :: CI Text
41 } deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 40 } deriving stock (Eq, Ord, Read, Show, Generic)
42 deriving newtype (PersistField, PersistFieldSql) 41 deriving newtype (PersistField, PersistFieldSql)
43makeWrapped ''MailLocal 42makeWrapped ''MailLocal
44newtype MailExtension = MailExtension 43newtype MailExtension = MailExtension
45 { unMailExtension :: CI Text 44 { unMailExtension :: CI Text
46 } deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 45 } deriving stock (Eq, Ord, Read, Show, Generic)
47 deriving newtype (PersistField, PersistFieldSql) 46 deriving newtype (PersistField, PersistFieldSql)
48makeWrapped ''MailExtension 47makeWrapped ''MailExtension
49newtype MailDomain = MailDomain 48newtype MailDomain = MailDomain
50 { unMailDomain :: CI Text 49 { unMailDomain :: CI Text
51 } deriving stock (Eq, Ord, Read, Show, Generic, Typeable) 50 } deriving stock (Eq, Ord, Read, Show, Generic)
52 deriving newtype (PersistField, PersistFieldSql) 51 deriving newtype (PersistField, PersistFieldSql)
53makeWrapped ''MailDomain 52makeWrapped ''MailDomain
54 53