2024-03-28 17:31:20 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
modulesPath,
|
|
|
|
nixos-hardware,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
imports = [
|
|
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
|
|
|
nixos-hardware.nixosModules.common-cpu-amd
|
|
|
|
nixos-hardware.nixosModules.common-cpu-amd-pstate
|
|
|
|
nixos-hardware.nixosModules.common-pc
|
|
|
|
nixos-hardware.nixosModules.common-pc-ssd
|
|
|
|
];
|
|
|
|
|
2024-03-29 21:00:21 +01:00
|
|
|
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
|
2024-03-28 17:31:20 +01:00
|
|
|
boot.initrd.kernelModules = ["dm-snapshot"];
|
|
|
|
boot.kernelModules = ["kvm-amd"];
|
|
|
|
boot.extraModulePackages = [];
|
2024-06-02 22:56:02 +02:00
|
|
|
boot.supportedFilesystems = {};
|
2024-03-28 17:31:20 +01:00
|
|
|
|
|
|
|
# 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=4G" "mode=755"]; # mode=755 so only root can write to those files
|
2024-03-28 17:31:20 +01: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 = 16 * 1024; # 16 GiB
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
# Enables DHCP on all ethernet and wireless LAN interfaces.
|
|
|
|
networking.useDHCP = lib.mkDefault true;
|
|
|
|
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
|
|
}
|