From e90a719ca86abe0b5da8047b7f43fc84d337fddc Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 6 Jan 2023 20:26:32 +0800 Subject: [PATCH] hosts/plover: update hardware config according to Hetzner Cloud defaults --- hosts/plover/hardware-configuration.nix | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/hosts/plover/hardware-configuration.nix b/hosts/plover/hardware-configuration.nix index 5f1d2c64..22e270ac 100644 --- a/hosts/plover/hardware-configuration.nix +++ b/hosts/plover/hardware-configuration.nix @@ -1,16 +1,19 @@ -{ lib, pkgs, modulesPath, ... }: +{ config, lib, pkgs, modulesPath, ... }: # Most of the filesystems listed here are supposed to be overriden to default # settings of whatever image format configuration this host system will import # from nixos-generators. +# +# Take note that this hardware configuration is mostly considered with Hetzner +# Cloud hardware server settings in mind. Be sure to replace it whenever you +# update your cloud provider. { imports = [ - (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/profiles/qemu-guest.nix") ]; boot.loader.grub.device = "/dev/sda"; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ]; + boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ]; boot.initrd.kernelModules = [ "nvme" ]; fileSystems."/" = lib.mkOverride 2000 { @@ -24,10 +27,14 @@ fsType = "vfat"; }; - zramSwap.enable = true; - swapDevices = [{ - label = "swap"; - options = [ "defaults" ]; - priority = 5; - }]; + zramSwap = { + enable = true; + numDevices = 1; + }; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + networking.useDHCP = false; + networking.interfaces.ens3.useDHCP = true; }