nixos/hosts/mu/hardware.nix

49 lines
1.2 KiB
Nix
Raw Normal View History

2024-03-05 22:57:41 +01:00
{
config,
lib,
pkgs,
modulesPath,
nixos-hardware,
...
}: {
2023-11-11 23:21:03 +01:00
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
nixos-hardware.nixosModules.common-cpu-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
];
2023-10-07 02:18:22 +02:00
2024-03-05 22:57:41 +01:00
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usbhid" "sdhci_pci"];
boot.initrd.kernelModules = ["dm-snapshot"];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
2023-10-07 02:18:22 +02:00
# https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
2024-08-31 03:29:21 +02:00
options = ["defaults" "size=50%" "mode=755"]; # mode=755 so only root can write to those files
2023-10-07 02:18:22 +02:00
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/nix";
neededForBoot = true;
2023-10-07 02:18:22 +02:00
fsType = "ext4";
};
swapDevices = [
{
device = "/nix/persist/swapfile";
size = 32 * 1024; # 32 GiB
}
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
}