From 701f8bd41fa49f4723acab5ea97b4aa857b484fb Mon Sep 17 00:00:00 2001 From: clerie Date: Sat, 15 Oct 2022 13:09:48 +0200 Subject: [PATCH] hosts/hydra-2: add host --- flake.nix | 6 +++++ hosts/hydra-2/configuration.nix | 34 ++++++++++++++++++++++++ hosts/hydra-2/hardware-configuration.nix | 32 ++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 hosts/hydra-2/configuration.nix create mode 100644 hosts/hydra-2/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index ac306b2..8988593 100644 --- a/flake.nix +++ b/flake.nix @@ -66,6 +66,12 @@ ./hosts/hydra-1/configuration.nix ]; }; + hydra-2 = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/hydra-2/configuration.nix + ]; + }; minecraft-2 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ diff --git a/hosts/hydra-2/configuration.nix b/hosts/hydra-2/configuration.nix new file mode 100644 index 0000000..cc6d3f4 --- /dev/null +++ b/hosts/hydra-2/configuration.nix @@ -0,0 +1,34 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ../../configuration/common + ../../configuration/proxmox-vm + ]; + + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.device = "/dev/vda"; + + networking.hostName = "hydra-2"; + + networking.useDHCP = false; + networking.interfaces.ens18.ipv6.addresses = [ { address = "2001:638:904:ffc1::100"; prefixLength = 64; } ]; + networking.interfaces.ens18.ipv4.addresses = [ { address = "141.24.50.112"; prefixLength = 24; } ]; + networking.defaultGateway6 = { address = "mtr 2001:638:904:ffc1::1"; interface = "ens18"; }; + networking.defaultGateway = { address = "141.24.50.1"; interface = "ens18"; }; + networking.nameservers = [ "2001:638:904:ffcc::3" "2001:638:904:ffcc::4" "141.24.40.3" "141.24.40.4" ]; + + # Allow Hydra to fetch remote URLs in restricted mode + nix.settings.allowed-uris = "http:// https://"; + + clerie.monitoring = { + enable = true; + id = "211"; + pubkey = "aWtxaM6GKhPwIJWRIQSqJwUa6nhfnD89JkkN9bt2NwE="; + }; + + system.stateVersion = "22.11"; +} diff --git a/hosts/hydra-2/hardware-configuration.nix b/hosts/hydra-2/hardware-configuration.nix new file mode 100644 index 0000000..618ad05 --- /dev/null +++ b/hosts/hydra-2/hardware-configuration.nix @@ -0,0 +1,32 @@ +# 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 + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/8ca81275-100c-4c09-82b5-665b1542444f"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + # networking.interfaces.ens19.useDHCP = lib.mkDefault true; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}