From fa062875e76106e892c4bcc40d9a716379af37bf Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Mon, 11 Dec 2023 21:11:14 +0400 Subject: [PATCH] add questionable availableKernelModules for DigitalOcean deployment --- nixos-infect | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos-infect b/nixos-infect index 9448ed0..87c165b 100755 --- a/nixos-infect +++ b/nixos-infect @@ -107,7 +107,17 @@ EOF return 1 fi + # FIXME it's questionable whether these modules are needed at all... + declare -a availableKernelModules=() + + [ "$PROVIDER" == "digitalocean" ] \ + && availableKernelModules+=('"ata_piix"' '"uhci_hcd"' '"xen_blkfront"') + + [ "$(uname -m)" == "x86_64" ] \ + && availableKernelModules+=('"vmw_pvscsi"') + # TODO try nixos-generate-config first, resorting to the way below if failed + # FIXME "nvme" is not needed for hetzner? cat << EOF { modulesPath, ... }: @@ -115,6 +125,7 @@ EOF imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; $bootcfg boot.initrd.kernelModules = [ "nvme" ]; + boot.initrd.availableKernelModules = [ ${availableKernelModules[@]} ]; fileSystems."/" = { device = "$ROOTFSDEV"; fsType = "$ROOTFSTYPE"; }; nixpkgs.hostPlatform = "${currentSystem}"; }