nixos/hosts/mu/hardware.nix
Casper V. Kristensen 588db7e044 increase root tmpfs
Needed to avoid out-of-space errors for builds using a lot of /tmp
space.
2024-04-17 22:11:53 +02:00

53 lines
1.4 KiB
Nix

{
config,
lib,
pkgs,
modulesPath,
nixos-hardware,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-gpu-intel
nixos-hardware.nixosModules.common-pc
nixos-hardware.nixosModules.common-pc-laptop
nixos-hardware.nixosModules.common-pc-laptop-acpi_call
nixos-hardware.nixosModules.common-pc-ssd
];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usbhid" "sdhci_pci"];
boot.initrd.kernelModules = ["dm-snapshot"];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
# https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = ["defaults" "size=4G" "mode=755"]; # mode=755 so only root can write to those files
};
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 = 32 * 1024; # 32 GiB
}
];
# Enables DHCP on all ethernet and wireless LAN interfaces.
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
}