diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2026-11-25 09:48:16 +0100 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2026-11-25 09:48:16 +0100 |
| commit | 0de15ae2403694b02de584ed5eee38d7c6e27b8b (patch) | |
| tree | 98ec7efab3cfcb248a3808310f1a91edc4a0861f /hosts | |
| parent | 2f83beb1ff4a0d9b4a731930a129866bd5e5d933 (diff) | |
| download | nixos-0de15ae2403694b02de584ed5eee38d7c6e27b8b.tar nixos-0de15ae2403694b02de584ed5eee38d7c6e27b8b.tar.gz nixos-0de15ae2403694b02de584ed5eee38d7c6e27b8b.tar.bz2 nixos-0de15ae2403694b02de584ed5eee38d7c6e27b8b.tar.xz nixos-0de15ae2403694b02de584ed5eee38d7c6e27b8b.zip | |
...flakes
Diffstat (limited to 'hosts')
| -rw-r--r-- | hosts/eostre/default.nix | 108 | ||||
| -rw-r--r-- | hosts/eostre/ruleset.nft | 101 | ||||
| -rw-r--r-- | hosts/skadhi/default.nix | 5 | ||||
| -rw-r--r-- | hosts/vidhar/default.nix | 2 | ||||
| -rw-r--r-- | hosts/vidhar/network/dhcp/default.nix | 102 |
5 files changed, 29 insertions, 289 deletions
diff --git a/hosts/eostre/default.nix b/hosts/eostre/default.nix deleted file mode 100644 index f8b48665..00000000 --- a/hosts/eostre/default.nix +++ /dev/null | |||
| @@ -1,108 +0,0 @@ | |||
| 1 | { flake, config, pkgs, lib, ... }: | ||
| 2 | |||
| 3 | with lib; | ||
| 4 | |||
| 5 | { | ||
| 6 | imports = with flake.nixosModules.systemProfiles; [ | ||
| 7 | default-locale nfsroot openssh | ||
| 8 | ]; | ||
| 9 | |||
| 10 | config = { | ||
| 11 | nixpkgs = { | ||
| 12 | system = "x86_64-linux"; | ||
| 13 | externalConfig = { | ||
| 14 | allowUnfree = true; | ||
| 15 | }; | ||
| 16 | extraOverlays = [ | ||
| 17 | (final: prev: { | ||
| 18 | upower = prev.upower.overrideAttrs (oldAttrs: { | ||
| 19 | doCheck = false; | ||
| 20 | }); | ||
| 21 | }) | ||
| 22 | ]; | ||
| 23 | }; | ||
| 24 | |||
| 25 | boot = { | ||
| 26 | initrd = { | ||
| 27 | availableKernelModules = [ "nvme" "ahci" "xhci_pci" "usbhid" "sd_mod" "sr_mod" ]; | ||
| 28 | kernelModules = [ "igb" ]; | ||
| 29 | }; | ||
| 30 | kernelModules = [ "kvm-amd" ]; | ||
| 31 | extraModulePackages = [ ]; | ||
| 32 | |||
| 33 | plymouth.enable = true; | ||
| 34 | |||
| 35 | tmp.useTmpfs = true; | ||
| 36 | }; | ||
| 37 | |||
| 38 | hardware = { | ||
| 39 | enableRedistributableFirmware = true; | ||
| 40 | cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware; | ||
| 41 | |||
| 42 | nvidia = { | ||
| 43 | modesetting.enable = true; | ||
| 44 | powerManagement.enable = true; | ||
| 45 | }; | ||
| 46 | |||
| 47 | graphics.enable = true; | ||
| 48 | }; | ||
| 49 | |||
| 50 | networking = { | ||
| 51 | domain = "lan.yggdrasil"; | ||
| 52 | search = [ "lan.yggdrasil" "yggdrasil" ]; | ||
| 53 | |||
| 54 | hosts = { | ||
| 55 | "127.0.0.1" = [ "eostre.lan.yggdrasil" "eostre" ]; | ||
| 56 | "::1" = [ "eostre.lan.yggdrasil" "eostre" ]; | ||
| 57 | }; | ||
| 58 | |||
| 59 | firewall.enable = false; | ||
| 60 | nftables = { | ||
| 61 | enable = true; | ||
| 62 | rulesetFile = ./ruleset.nft; | ||
| 63 | }; | ||
| 64 | }; | ||
| 65 | |||
| 66 | services.resolved = { | ||
| 67 | llmnr = "false"; | ||
| 68 | }; | ||
| 69 | |||
| 70 | zramSwap.enable = true; | ||
| 71 | |||
| 72 | system.stateVersion = "22.11"; | ||
| 73 | |||
| 74 | |||
| 75 | console.keyMap = "us"; | ||
| 76 | time.hardwareClockInLocalTime = true; | ||
| 77 | |||
| 78 | |||
| 79 | environment.systemPackages = with pkgs; [ cifs-utils ]; | ||
| 80 | |||
| 81 | security.pam.mount = { | ||
| 82 | enable = true; | ||
| 83 | extraVolumes = [ | ||
| 84 | "<volume sgrp=\"users\" fstype=\"cifs\" server=\"vidhar.lan.yggdrasil\" path=\"home-eostre\" mountpoint=\"~\" options=\"mfsymlinks\" />" | ||
| 85 | "<volume sgrp=\"users\" fstype=\"cifs\" server=\"vidhar.lan.yggdrasil\" path=\"%(USER)\" mountpoint=\"/run/media/%(USER)/vidhar\" options=\"mfsymlinks,noexec,nosuid\" />" | ||
| 86 | ]; | ||
| 87 | }; | ||
| 88 | |||
| 89 | services.displayManager.sddm = { | ||
| 90 | enable = true; | ||
| 91 | wayland.enable = true; | ||
| 92 | settings = { | ||
| 93 | Users.HideUsers = "gkleen"; | ||
| 94 | }; | ||
| 95 | }; | ||
| 96 | services.desktopManager.plasma6.enable = true; | ||
| 97 | |||
| 98 | |||
| 99 | services.openssh = { | ||
| 100 | enable = true; | ||
| 101 | startWhenNeeded = true; | ||
| 102 | settings = { | ||
| 103 | PasswordAuthentication = true; | ||
| 104 | KbdInteractiveAuthentication = true; | ||
| 105 | }; | ||
| 106 | }; | ||
| 107 | }; | ||
| 108 | } | ||
diff --git a/hosts/eostre/ruleset.nft b/hosts/eostre/ruleset.nft deleted file mode 100644 index 7b38a059..00000000 --- a/hosts/eostre/ruleset.nft +++ /dev/null | |||
| @@ -1,101 +0,0 @@ | |||
| 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 | chain input { | ||
| 9 | type filter hook input priority filter | ||
| 10 | policy accept | ||
| 11 | |||
| 12 | limit name lim_arp counter drop | ||
| 13 | |||
| 14 | counter | ||
| 15 | } | ||
| 16 | |||
| 17 | chain output { | ||
| 18 | type filter hook output priority filter | ||
| 19 | policy accept | ||
| 20 | |||
| 21 | limit name lim_arp counter drop | ||
| 22 | |||
| 23 | counter | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | table inet filter { | ||
| 28 | limit lim_reject { | ||
| 29 | rate over 1000/second burst 1000 packets | ||
| 30 | } | ||
| 31 | |||
| 32 | limit lim_icmp { | ||
| 33 | rate over 50 mbytes/second burst 50 mbytes | ||
| 34 | } | ||
| 35 | |||
| 36 | |||
| 37 | chain forward { | ||
| 38 | type filter hook forward priority filter | ||
| 39 | policy drop | ||
| 40 | |||
| 41 | |||
| 42 | ct state invalid log level debug prefix "drop invalid forward: " counter drop | ||
| 43 | |||
| 44 | |||
| 45 | iifname lo counter accept | ||
| 46 | |||
| 47 | |||
| 48 | limit name lim_reject log level debug prefix "drop forward: " counter drop | ||
| 49 | log level debug prefix "reject forward: " counter | ||
| 50 | meta l4proto tcp ct state new counter reject with tcp reset | ||
| 51 | ct state new counter reject | ||
| 52 | |||
| 53 | |||
| 54 | counter | ||
| 55 | } | ||
| 56 | |||
| 57 | chain input { | ||
| 58 | type filter hook input priority filter | ||
| 59 | policy drop | ||
| 60 | |||
| 61 | |||
| 62 | ct state invalid log level debug prefix "drop invalid input: " counter drop | ||
| 63 | |||
| 64 | |||
| 65 | iifname lo counter accept | ||
| 66 | iif != lo ip daddr 127.0.0.1/8 counter reject | ||
| 67 | iif != lo ip6 daddr ::1/128 counter reject | ||
| 68 | |||
| 69 | meta l4proto $icmp_protos limit name lim_icmp counter drop | ||
| 70 | meta l4proto $icmp_protos counter accept | ||
| 71 | |||
| 72 | tcp dport 22 counter accept | ||
| 73 | udp dport 60000-61000 counter accept | ||
| 74 | |||
| 75 | |||
| 76 | ct state {established, related} counter accept | ||
| 77 | |||
| 78 | |||
| 79 | limit name lim_reject log level debug prefix "drop input: " counter drop | ||
| 80 | log level debug prefix "reject input: " counter | ||
| 81 | meta l4proto tcp ct state new counter reject with tcp reset | ||
| 82 | ct state new counter reject | ||
| 83 | |||
| 84 | |||
| 85 | counter | ||
| 86 | } | ||
| 87 | |||
| 88 | chain output { | ||
| 89 | type filter hook output priority filter | ||
| 90 | policy accept | ||
| 91 | |||
| 92 | |||
| 93 | oifname lo counter accept | ||
| 94 | |||
| 95 | meta l4proto $icmp_protos limit name lim_icmp counter drop | ||
| 96 | meta l4proto $icmp_protos counter accept | ||
| 97 | |||
| 98 | |||
| 99 | counter | ||
| 100 | } | ||
| 101 | } \ No newline at end of file | ||
diff --git a/hosts/skadhi/default.nix b/hosts/skadhi/default.nix index cf25777b..ee65bbbe 100644 --- a/hosts/skadhi/default.nix +++ b/hosts/skadhi/default.nix | |||
| @@ -114,5 +114,10 @@ | |||
| 114 | }; | 114 | }; |
| 115 | restartIfChanged = false; | 115 | restartIfChanged = false; |
| 116 | }; | 116 | }; |
| 117 | nixpkgs.externalConfig = { | ||
| 118 | problems.handlers = { | ||
| 119 | "gtk+".broken = "warn"; # or "ignore" | ||
| 120 | }; | ||
| 121 | }; | ||
| 117 | }; | 122 | }; |
| 118 | } | 123 | } |
diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix index e97eb20b..90e08a5a 100644 --- a/hosts/vidhar/default.nix +++ b/hosts/vidhar/default.nix | |||
| @@ -8,7 +8,6 @@ with lib; | |||
| 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 |
| 11 | initrd-ssh | ||
| 12 | ]; | 11 | ]; |
| 13 | 12 | ||
| 14 | config = { | 13 | config = { |
| @@ -35,7 +34,6 @@ with lib; | |||
| 35 | 34 | ||
| 36 | initrd = { | 35 | initrd = { |
| 37 | systemd = { | 36 | systemd = { |
| 38 | enable = true; | ||
| 39 | network = { | 37 | network = { |
| 40 | enable = true; | 38 | enable = true; |
| 41 | networks = { | 39 | networks = { |
diff --git a/hosts/vidhar/network/dhcp/default.nix b/hosts/vidhar/network/dhcp/default.nix index e4c3f16e..2efabd23 100644 --- a/hosts/vidhar/network/dhcp/default.nix +++ b/hosts/vidhar/network/dhcp/default.nix | |||
| @@ -48,12 +48,6 @@ in { | |||
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | client-classes = [ | 50 | client-classes = [ |
| 51 | # { name = "ipxe-eostre"; | ||
| 52 | # test = "hexstring(pkt4.mac, ':') == '00:d8:61:79:c5:40' and option[77].hex == 'iPXE-yggdrasil'"; | ||
| 53 | # next-server = tftpIp; | ||
| 54 | # boot-file-name = "${nfsrootBaseUrl}/eostre.menu.ipxe"; | ||
| 55 | # only-if-required = true; | ||
| 56 | # } | ||
| 57 | { name = "ipxe-yggdrasil"; | 51 | { name = "ipxe-yggdrasil"; |
| 58 | test = "option[77].hex == 'iPXE-yggdrasil'"; | 52 | test = "option[77].hex == 'iPXE-yggdrasil'"; |
| 59 | next-server = tftpIp; | 53 | next-server = tftpIp; |
| @@ -294,43 +288,46 @@ in { | |||
| 294 | name = "installer-${system}"; | 288 | name = "installer-${system}"; |
| 295 | paths = [ | 289 | paths = [ |
| 296 | (builtins.addErrorContext "while evaluating installer-${system}-nfsroot" (let | 290 | (builtins.addErrorContext "while evaluating installer-${system}-nfsroot" (let |
| 297 | installerBuild' = (flake.nixosConfigurations.${"installer-${system}-nfsroot"}.extendModules { | 291 | # installerBuild' = (flake.nixosConfigurations.${"installer-${system}-nfsroot"}.extendModules { |
| 298 | modules = [ | 292 | # modules = [ |
| 299 | ({ ... }: { | 293 | # ({ ... }: { |
| 300 | config.nfsroot.storeDevice = "${nfsIp}:nix-store"; | 294 | # config.nfsroot.storeDevice = "${nfsIp}:nix-store"; |
| 301 | config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/installer-${system}/registration"; | 295 | # config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/installer-${system}/registration"; |
| 302 | config.system.nixos.label = "installer-${system}"; | 296 | # config.system.nixos.label = "installer-${system}"; |
| 303 | }) | 297 | # }) |
| 304 | ]; | 298 | # ]; |
| 305 | }); | 299 | # }); |
| 306 | installerBuild = installerBuild'.config.system.build; | 300 | # installerBuild = installerBuild'.config.system.build; |
| 301 | |||
| 302 | # install -m 0444 -t $out/installer-${system} \ | ||
| 303 | # ${installerBuild.initialRamdisk}/initrd \ | ||
| 304 | # ${installerBuild.kernel}/bzImage \ | ||
| 305 | # ${installerBuild.netbootIpxeScript}/netboot.ipxe \ | ||
| 306 | # ${pkgs.closureInfo { rootPaths = installerBuild.storeContents; }}/registration | ||
| 307 | |||
| 308 | # item installer ${with installerBuild'; "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"} | ||
| 309 | |||
| 310 | # :installer | ||
| 311 | # chain installer-${system}/netboot.ipxe | ||
| 312 | # goto start | ||
| 313 | |||
| 307 | in builtins.toPath (pkgs.runCommandLocal "installer-${system}" {} '' | 314 | in builtins.toPath (pkgs.runCommandLocal "installer-${system}" {} '' |
| 308 | mkdir -p $out/installer-${system} | 315 | mkdir -p $out/installer-${system} |
| 309 | install -m 0444 -t $out/installer-${system} \ | ||
| 310 | ${installerBuild.initialRamdisk}/initrd \ | ||
| 311 | ${installerBuild.kernel}/bzImage \ | ||
| 312 | ${installerBuild.netbootIpxeScript}/netboot.ipxe \ | ||
| 313 | ${pkgs.closureInfo { rootPaths = installerBuild.storeContents; }}/registration | ||
| 314 | install -m 0444 ${pkgs.writeText "installer-${system}.menu.ipxe" '' | 316 | install -m 0444 ${pkgs.writeText "installer-${system}.menu.ipxe" '' |
| 315 | #!ipxe | 317 | #!ipxe |
| 316 | 318 | ||
| 317 | :start | 319 | :start |
| 318 | menu iPXE boot menu for installer-${system} | 320 | menu iPXE boot menu for installer-${system} |
| 319 | item installer ${with installerBuild'; "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"} | ||
| 320 | item memtest memtest86plus | 321 | item memtest memtest86plus |
| 321 | item netboot netboot.xyz | 322 | item netboot netboot.xyz |
| 322 | item shell iPXE shell | 323 | item shell iPXE shell |
| 323 | choose --timeout 0 --default installer selected || goto shell | 324 | choose --timeout 0 --default netboot selected || goto shell |
| 324 | goto ''${selected} | 325 | goto ''${selected} |
| 325 | 326 | ||
| 326 | :shell | 327 | :shell |
| 327 | shell | 328 | shell |
| 328 | goto start | 329 | goto start |
| 329 | 330 | ||
| 330 | :installer | ||
| 331 | chain installer-${system}/netboot.ipxe | ||
| 332 | goto start | ||
| 333 | |||
| 334 | :netboot | 331 | :netboot |
| 335 | iseq ''${platform} efi && chain --autofree netboot.xyz.efi || chain --autofree netboot.xyz.lkrn | 332 | iseq ''${platform} efi && chain --autofree netboot.xyz.efi || chain --autofree netboot.xyz.lkrn |
| 336 | goto start | 333 | goto start |
| @@ -351,57 +348,6 @@ in { | |||
| 351 | install -m 0444 ${sources.netbootxyz-efi.src} $out/netboot.xyz.efi | 348 | install -m 0444 ${sources.netbootxyz-efi.src} $out/netboot.xyz.efi |
| 352 | install -m 0444 ${sources.netbootxyz-lkrn.src} $out/netboot.xyz.lkrn | 349 | install -m 0444 ${sources.netbootxyz-lkrn.src} $out/netboot.xyz.lkrn |
| 353 | '') | 350 | '') |
| 354 | # (builtins.addErrorContext "while evaluating eostre" (let | ||
| 355 | # eostreBuild' = (flake.nixosConfigurations.eostre.extendModules { | ||
| 356 | # modules = [ | ||
| 357 | # ({ ... }: { | ||
| 358 | # config.nfsroot.storeDevice = "${nfsIp}:nix-store"; | ||
| 359 | # config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/eostre/registration"; | ||
| 360 | # config.system.nixos.label = "eostre"; | ||
| 361 | # }) | ||
| 362 | # ]; | ||
| 363 | # }); | ||
| 364 | # eostreBuild = eostreBuild'.config.system.build; | ||
| 365 | # in builtins.toPath (pkgs.runCommandLocal "eostre" {} '' | ||
| 366 | # mkdir -p $out/eostre | ||
| 367 | # install -m 0444 -t $out/eostre \ | ||
| 368 | # ${eostreBuild.initialRamdisk}/initrd \ | ||
| 369 | # ${eostreBuild.kernel}/bzImage \ | ||
| 370 | # ${eostreBuild.netbootIpxeScript}/netboot.ipxe \ | ||
| 371 | # ${pkgs.closureInfo { rootPaths = eostreBuild.storeContents; }}/registration | ||
| 372 | # install -m 0444 ${pkgs.writeText "eostre.menu.ipxe" '' | ||
| 373 | # #!ipxe | ||
| 374 | |||
| 375 | # set menu-timeout 5000 | ||
| 376 | |||
| 377 | # :start | ||
| 378 | # menu iPXE boot menu for eostre | ||
| 379 | # item eostre ${with eostreBuild'; "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"} | ||
| 380 | # item memtest memtest86plus | ||
| 381 | # item netboot netboot.xyz | ||
| 382 | # item shell iPXE shell | ||
| 383 | # choose --timeout ''${menu-timeout} --default eostre selected || goto shell | ||
| 384 | # set menu-timeout 0 | ||
| 385 | # goto ''${selected} | ||
| 386 | |||
| 387 | # :shell | ||
| 388 | # set menu-timeout 0 | ||
| 389 | # shell | ||
| 390 | # goto start | ||
| 391 | |||
| 392 | # :eostre | ||
| 393 | # chain eostre/netboot.ipxe | ||
| 394 | # goto start | ||
| 395 | |||
| 396 | # :netboot | ||
| 397 | # iseq ''${platform} efi && chain --autofree netboot.xyz.efi || chain --autofree netboot.xyz.lkrn | ||
| 398 | # goto start | ||
| 399 | |||
| 400 | # :memtest | ||
| 401 | # chain --autofree mt86plus.efi | ||
| 402 | # goto start | ||
| 403 | # ''} $out/eostre.menu.ipxe | ||
| 404 | # ''))) | ||
| 405 | ]; | 351 | ]; |
| 406 | }; | 352 | }; |
| 407 | }; | 353 | }; |
