2024-03-05 22:57:41 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
modulesPath,
|
|
|
|
...
|
|
|
|
}: {
|
2023-11-11 23:20:48 +01:00
|
|
|
imports = [
|
|
|
|
(modulesPath + "/profiles/qemu-guest.nix")
|
|
|
|
];
|
2023-08-06 00:45:08 +02:00
|
|
|
|
2024-03-05 22:57:41 +01:00
|
|
|
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
|
|
|
|
boot.initrd.kernelModules = ["dm-snapshot"];
|
|
|
|
boot.kernelModules = [];
|
|
|
|
boot.extraModulePackages = [];
|
2023-08-06 00:45:08 +02:00
|
|
|
|
2023-08-11 17:51:39 +02:00
|
|
|
# https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/
|
|
|
|
fileSystems."/" = {
|
|
|
|
device = "none";
|
|
|
|
fsType = "tmpfs";
|
2024-03-05 22:57:41 +01:00
|
|
|
options = ["defaults" "size=2G" "mode=755"]; # mode=755 so only root can write to those files
|
2023-08-11 17:51:39 +02:00
|
|
|
};
|
|
|
|
fileSystems."/boot" = {
|
|
|
|
device = "/dev/disk/by-label/BOOT";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
fileSystems."/nix" = {
|
|
|
|
device = "/dev/disk/by-label/nix";
|
2024-02-23 21:59:04 +01:00
|
|
|
neededForBoot = true;
|
2023-08-11 17:51:39 +02:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
2023-08-06 00:45:08 +02:00
|
|
|
|
|
|
|
swapDevices = [
|
|
|
|
{
|
|
|
|
device = "/nix/persist/swapfile";
|
|
|
|
size = 4 * 1024; # 4 GiB
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2023-08-11 18:02:36 +02:00
|
|
|
# Enables DHCP on all ethernet and wireless LAN interfaces.
|
2023-08-06 00:45:08 +02:00
|
|
|
networking.useDHCP = lib.mkDefault true;
|
|
|
|
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
|
|
}
|