diff --git a/config/cache.nix b/config/cache.nix index 5083097f..a37f9583 100644 --- a/config/cache.nix +++ b/config/cache.nix @@ -5,7 +5,7 @@ "https://nix-serve.hq.c3d2.de" ]; binaryCachePublicKeys = [ - (builtins.readFile ../hosts/containers/hydra/cache-pub.key) + (builtins.readFile ../hosts/hydra/cache-pub.key) ]; }; } diff --git a/flake.lock b/flake.lock index e5fa00ef..ecae6347 100644 --- a/flake.lock +++ b/flake.lock @@ -409,11 +409,11 @@ "openwrt-imagebuilder": "openwrt-imagebuilder" }, "locked": { - "lastModified": 1651275116, - "narHash": "sha256-I6gXlwQteHGcJGbAMXegJyXL7cd4Pz/b6MjoOUGz4wU=", + "lastModified": 1651782857, + "narHash": "sha256-EPkyxja/JOwrQnzbbmpSmMRzR5Dsp1QQwBPCvFWqn3Y=", "ref": "master", - "rev": "7a00fd74cf205e87cc8b82f18e90037e9f0311a8", - "revCount": 1382, + "rev": "52dbdc237abae93fc93ad9ca8b3d349c36989ad0", + "revCount": 1388, "type": "git", "url": "https://gitea.c3d2.de/zentralwerk/network.git" }, diff --git a/flake.nix b/flake.nix index 6869ef41..e900603b 100644 --- a/flake.nix +++ b/flake.nix @@ -393,8 +393,7 @@ hydra = nixosSystem' { modules = [ - ./config/lxc-container.nix - ./hosts/containers/hydra + ./hosts/hydra { sops.defaultSopsFile = "${secrets}/hosts/hydra/secrets.yaml"; } diff --git a/host-registry.nix b/host-registry.nix index caa5fdda..1e867370 100644 --- a/host-registry.nix +++ b/host-registry.nix @@ -27,11 +27,6 @@ publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPFB9fo01jzr2upEBEXiR7sSmeQoq9ll5Cf5/hjq5e4Y"; }; - hydra = { - ip4 = "172.20.73.49"; - ip6 = "2a00:8180:2c00:282:e03c:d7ff:fe8e:fe16"; - }; - kibana = { ip4 = "172.20.73.44"; ip6 = "2a00:8180:2c00:282:460:7cff:fe28:76b2"; diff --git a/hosts/containers/hydra/c3d2.svg b/hosts/hydra/c3d2.svg similarity index 100% rename from hosts/containers/hydra/c3d2.svg rename to hosts/hydra/c3d2.svg diff --git a/hosts/containers/hydra/cache-pub.key b/hosts/hydra/cache-pub.key similarity index 100% rename from hosts/containers/hydra/cache-pub.key rename to hosts/hydra/cache-pub.key diff --git a/hosts/containers/hydra/cache.nix b/hosts/hydra/cache.nix similarity index 100% rename from hosts/containers/hydra/cache.nix rename to hosts/hydra/cache.nix diff --git a/hosts/containers/hydra/default.nix b/hosts/hydra/default.nix similarity index 70% rename from hosts/containers/hydra/default.nix rename to hosts/hydra/default.nix index a3c2f76b..bf04e72e 100644 --- a/hosts/containers/hydra/default.nix +++ b/hosts/hydra/default.nix @@ -2,6 +2,7 @@ { imports = [ + ./hardware-configuration.nix ./hydra.nix ./cache.nix ./updater.nix @@ -33,24 +34,35 @@ boot = { tmpOnTmpfs = true; + kernelModules = [ "kvm-intel" ]; + kernelParams = [ "mitigations=off" "preempt=none" ]; # For cross-building - binfmt.emulatedSystems = [ "aarch64-linux" ]; - }; - - fileSystems."/" = { - fsType = "rootfs"; - device = "rootfs"; + binfmt.emulatedSystems = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" "riscv32-linux" "riscv64-linux" ]; }; networking = { hostName = "hydra"; firewall.enable = false; defaultGateway = "172.20.73.1"; - interfaces.eth0.ipv4.addresses = [{ - address = "172.20.73.49"; - prefixLength = zentralwerk.lib.config.site.net.serv.subnet4Len; - }]; + interfaces.enp3s0 = { + useDHCP = false; + tempAddress = "disabled"; + ipv4.addresses = [{ + address = "172.20.73.49"; + prefixLength = zentralwerk.lib.config.site.net.serv.subnet4Len; + }]; + }; + nameservers = [ "172.20.73.8" "9.9.9.9" ]; }; + networking.interfaces.eth0 = { + useDHCP = false; + tempAddress = "disabled"; + }; + systemd.network.networks."40-eth0" + .networkConfig = { + IPv6AcceptRA = true; + LinkLocalAddressing = "ipv6"; + }; nixpkgs.config.packageOverrides = pkgs: { # HACK: nix-2.5.1 is broken diff --git a/hosts/hydra/hardware-configuration.nix b/hosts/hydra/hardware-configuration.nix new file mode 100644 index 00000000..b4134a63 --- /dev/null +++ b/hosts/hydra/hardware-configuration.nix @@ -0,0 +1,41 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + # boot.loader.grub.efiSupport = true; + # boot.loader.grub.efiInstallAsRemovable = true; + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; + # Define on which hard drive you want to install Grub. + boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only + + boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ata_piix" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/6259dd9a-582b-41bc-aced-8aff8ed9ff32"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D8D1-372E"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/d5e112a4-fcd3-461a-b2eb-21c6a10ad108"; } + ]; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} + diff --git a/hosts/containers/hydra/hydra.nix b/hosts/hydra/hydra.nix similarity index 86% rename from hosts/containers/hydra/hydra.nix rename to hosts/hydra/hydra.nix index d4890c56..7264c580 100644 --- a/hosts/containers/hydra/hydra.nix +++ b/hosts/hydra/hydra.nix @@ -11,7 +11,7 @@ in { buildMachines = [ { hostName = "localhost"; system = "x86_64-linux"; - supportedFeatures = [ "big-parallel" "benchmark" ]; + supportedFeatures = [ "big-parallel" "benchmark" "kvm" "nixos-test" ]; maxJobs = 4; } { hostName = nix-build; @@ -23,7 +23,13 @@ in { system = "aarch64-linux"; supportedFeatures = [ "nixos-test" "big-parallel" "benchmark" ]; maxJobs = 4; - } ]; + } ] ++ + map (system: { + hostName = "localhost"; + inherit system; + supportedFeatures = [ "nixos-test" "big-parallel" "benchmark" ]; + maxJobs = 4; + }) config.boot.binfmt.emulatedSystems; daemonCPUSchedPolicy = "idle"; daemonIOSchedClass = "idle"; diff --git a/hosts/containers/hydra/updater.nix b/hosts/hydra/updater.nix similarity index 100% rename from hosts/containers/hydra/updater.nix rename to hosts/hydra/updater.nix