From 8a45ba36e792a5a1adb7ae6ee02e295ca373eeaf Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 28 Sep 2024 19:02:33 +0800 Subject: [PATCH] hosts/plover/profiles/hetzner-cloud-cx22: migrate certain settings to it as part of the profile --- .../modules/profiles/hetzner-cloud-cx22.nix | 20 ++++++++++++++++++- .../plover/modules/services/networking.nix | 16 --------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/configs/nixos/plover/modules/profiles/hetzner-cloud-cx22.nix b/configs/nixos/plover/modules/profiles/hetzner-cloud-cx22.nix index f5f7a114..c96eb7fa 100644 --- a/configs/nixos/plover/modules/profiles/hetzner-cloud-cx22.nix +++ b/configs/nixos/plover/modules/profiles/hetzner-cloud-cx22.nix @@ -1,7 +1,25 @@ -{ modulesPath, ... }: +{ config, lib, pkgs, modulesPath, ... }: { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + + # Hetzner can only support non-UEFI bootloader (or at least it doesn't with + # systemd-boot). + boot.loader.grub = { + enable = lib.mkForce true; + efiSupport = true; + efiInstallAsRemovable = true; + }; + + boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ "nvme" ]; + + zramSwap.enable = true; + + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + services.qemuGuest.enable = true; + systemd.services.qemu-guest-agent.path = [ pkgs.shadow ]; } diff --git a/configs/nixos/plover/modules/services/networking.nix b/configs/nixos/plover/modules/services/networking.nix index db0b289f..d5ad7afd 100644 --- a/configs/nixos/plover/modules/services/networking.nix +++ b/configs/nixos/plover/modules/services/networking.nix @@ -14,22 +14,6 @@ in lib.mkEnableOption "preferred networking setup"; config = lib.mkIf cfg.enable { - # Hetzner can only support non-UEFI bootloader (or at least it doesn't with - # systemd-boot). - boot.loader.grub = { - enable = lib.mkForce true; - device = "/dev/sda"; - efiSupport = true; - efiInstallAsRemovable = true; - }; - - boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ "nvme" ]; - - zramSwap.enable = true; - - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - networking = { enableIPv6 = true; usePredictableInterfaceNames = lib.mkDefault true;