2024-04-05 23:45:55 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
modulesPath,
|
|
|
|
...
|
|
|
|
}: {
|
2024-06-27 20:37:34 +02:00
|
|
|
# https://wiki.nixos.org/wiki/Install_NixOS_on_Hetzner_Cloud
|
2024-04-05 23:45:55 +02:00
|
|
|
imports = [
|
|
|
|
(modulesPath + "/profiles/qemu-guest.nix")
|
|
|
|
];
|
|
|
|
|
|
|
|
boot.initrd.availableKernelModules = ["xhci_pci" "virtio_pci" "virtio_scsi" "usbhid" "sr_mod"];
|
|
|
|
boot.initrd.kernelModules = ["dm-snapshot" "virtio_gpu"];
|
|
|
|
boot.kernelParams = ["console=tty"];
|
|
|
|
boot.kernelModules = [];
|
|
|
|
boot.extraModulePackages = [];
|
|
|
|
|
|
|
|
# https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/
|
|
|
|
fileSystems."/" = {
|
|
|
|
device = "none";
|
|
|
|
fsType = "tmpfs";
|
2024-04-17 22:11:53 +02:00
|
|
|
options = ["defaults" "size=3G" "mode=755"]; # mode=755 so only root can write to those files
|
2024-04-05 23:45:55 +02:00
|
|
|
};
|
|
|
|
fileSystems."/boot" = {
|
|
|
|
device = "/dev/disk/by-label/BOOT";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
fileSystems."/nix" = {
|
|
|
|
device = "/dev/disk/by-label/nix";
|
|
|
|
neededForBoot = true;
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
|
|
|
|
swapDevices = [
|
|
|
|
{
|
|
|
|
device = "/nix/persist/swapfile";
|
|
|
|
size = 4 * 1024; # 4 GiB
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
|
|
|
}
|