From fef9786d6c4031e775c28db3c779789d98c7d9e3 Mon Sep 17 00:00:00 2001 From: Fern Garden Date: Fri, 4 Jul 2025 22:24:58 +0800 Subject: [PATCH] Add vm-docker hardware config --- hardware-configuration/vm-docker.nix | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 hardware-configuration/vm-docker.nix diff --git a/hardware-configuration/vm-docker.nix b/hardware-configuration/vm-docker.nix new file mode 100644 index 0000000..bf8baa4 --- /dev/null +++ b/hardware-configuration/vm-docker.nix @@ -0,0 +1,30 @@ +{ lib, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/cac60222-9b38-4938-8b17-5fddd67e8e26"; + fsType = "ext4"; + }; + + fileSystems."/home/docker/volumes" = + { device = "/dev/disk/by-uuid/95461a94-ad91-43b9-b502-2b5d4496b84e"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/025beadb-a89b-4abe-8d0c-b55401316319"; } + ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} \ No newline at end of file