diff --git a/hosts/tor/hardware.nix b/hosts/tor/hardware.nix index 0a546a1..c3be88e 100644 --- a/hosts/tor/hardware.nix +++ b/hosts/tor/hardware.nix @@ -9,7 +9,7 @@ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk"]; + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod"]; boot.initrd.kernelModules = ["dm-snapshot"]; boot.kernelModules = []; boot.extraModulePackages = []; @@ -37,5 +37,17 @@ } ]; + # Enable hot-adding memory + # https://pve.proxmox.com/wiki/Hotplug_(qemu_disk,nic,cpu,memory) + # Nix code inspired by (this isn't hyperv): + # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/hyperv-guest.nix + services.udev.packages = lib.singleton (pkgs.writeTextFile { + name = "proxmox-memory-hotadd-udev-rules"; + destination = "/etc/udev/rules.d/80-hotplug-mem.rules"; + text = '' + SUBSYSTEM=="memory", ACTION=="add", TEST=="state", ATTR{state}=="offline", ATTR{state}="online" + ''; + }); + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; }