# Hetzner Cloud VM as nixos-infect leaves it: the Debian image's disk # (sda1 ext4 root, sda14 BIOS boot, sda15 unused ESP), GRUB in the MBR. { lib, modulesPath, ... }: { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; boot.loader.grub.device = "/dev/sda"; boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" ]; fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; boot.tmp.cleanOnBoot = true; services.qemuGuest.enable = true; # Public interface: IPv4 by DHCP, IPv6 static (asxpio.ipv6, Hetzner # offers no router advertisements). Private network: DHCP, never the # default route. Names differ between a switch from the bootstrap # system (eth0) and a boot of this one (enp1s0). networking.useDHCP = false; networking.useNetworkd = true; systemd.network.enable = true; systemd.network.networks = { "10-public" = { matchConfig.Name = "enp1s0 eth0"; networkConfig.DHCP = "ipv4"; routes = [ { Gateway = "fe80::1"; } ]; }; "20-private" = { matchConfig.Name = "enp7s0 ens10"; networkConfig.DHCP = "ipv4"; dhcpV4Config = { RouteMetric = 2000; UseDNS = false; }; linkConfig.RequiredForOnline = "no"; }; }; # Name resolution on the local link is of no use on a server services.resolved.settings.Resolve = { LLMNR = false; MulticastDNS = false; }; networking.nameservers = lib.mkDefault [ "185.12.64.1" "185.12.64.2" "2a01:4ff:ff00::add:1" ]; }