Files
hermenix/guest/hardware.nix
T
2026-09-17 14:14:14 -04:00

35 lines
1.1 KiB
Nix

{ lib, ... }:
# Only used by the guest's own /etc/nixos flake (see guest/flake.nix). The
# bootstrap image gets its partitioning and bootloader from nixos-generators
# instead, which is why fileSystems/bootloader are kept out of common.nix -
# but driver support for the VM environment (qemu-guest.nix profile, virtio
# initrd modules) lives in common.nix instead, since the bootstrap image
# needs that too. See common.nix if you're looking for that.
#
# VERIFY THE LABELS on first boot with `lsblk -f`. nixos-generators names the
# root partition "nixos" and the ESP "ESP", but check rather than trust, and
# fix here if they differ. Getting this wrong means the first self-rebuild
# produces a system that will not boot.
{
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}