Add filesystem configuration matching Proxmox image builder output to allow template2 to build with both `nixos-rebuild build` and `nixos-rebuild build-image --image-variant proxmox`. Filesystem specs discovered from running VM: - ext4 filesystem with label "nixos" - x-systemd.growfs option for automatic partition growth - No swap partition Using lib.mkDefault ensures these definitions work for normal builds while allowing the Proxmox image builder to override when needed. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
46 lines
1.2 KiB
Nix
46 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
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 = [ "dm-snapshot" ];
|
|
boot.kernelModules = [
|
|
"ptp_kvm"
|
|
"virtio_rng" # Provides entropy from host for fast SSH key generation
|
|
];
|
|
boot.extraModulePackages = [ ];
|
|
|
|
# Filesystem configuration matching Proxmox image builder output
|
|
fileSystems."/" = lib.mkDefault {
|
|
device = "/dev/disk/by-label/nixos";
|
|
fsType = "ext4";
|
|
options = [ "x-systemd.growfs" ];
|
|
};
|
|
|
|
swapDevices = lib.mkDefault [ ];
|
|
|
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
# still possible to use this option, but it's recommended to use it in conjunction
|
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
|
networking.useDHCP = lib.mkDefault true;
|
|
# networking.interfaces.ens18.useDHCP = lib.mkDefault true;
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
}
|