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