add questionable availableKernelModules for DigitalOcean deployment

This commit is contained in:
Alexander Tomokhov 2023-12-11 21:11:14 +04:00
parent 528d5de6dd
commit fa062875e7

View file

@ -107,7 +107,17 @@ EOF
return 1 return 1
fi 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 # TODO try nixos-generate-config first, resorting to the way below if failed
# FIXME "nvme" is not needed for hetzner?
cat << EOF cat << EOF
{ modulesPath, ... }: { modulesPath, ... }:
@ -115,6 +125,7 @@ EOF
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
$bootcfg $bootcfg
boot.initrd.kernelModules = [ "nvme" ]; boot.initrd.kernelModules = [ "nvme" ];
boot.initrd.availableKernelModules = [ ${availableKernelModules[@]} ];
fileSystems."/" = { device = "$ROOTFSDEV"; fsType = "$ROOTFSTYPE"; }; fileSystems."/" = { device = "$ROOTFSDEV"; fsType = "$ROOTFSTYPE"; };
nixpkgs.hostPlatform = "${currentSystem}"; nixpkgs.hostPlatform = "${currentSystem}";
} }