2023-11-11 23:21:12 +01:00
|
|
|
{ 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
|
|
|
|
];
|
2023-08-01 16:31:44 +02:00
|
|
|
|
|
|
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
|
|
|
|
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";
|
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 16:31:44 +02:00
|
|
|
};
|
|
|
|
fileSystems."/boot" = {
|
|
|
|
device = "/dev/disk/by-label/BOOT";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
fileSystems."/nix" = {
|
|
|
|
device = "/dev/disk/by-label/nix";
|
2024-02-23 21:59:04 +01:00
|
|
|
neededForBoot = true;
|
2023-08-01 16:31:44 +02:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
|
|
|
|
swapDevices = [
|
2023-08-01 16:55:53 +02:00
|
|
|
{
|
|
|
|
device = "/nix/persist/swapfile";
|
|
|
|
size = 8 * 1024; # 8 GiB
|
|
|
|
}
|
2023-08-01 16:31:44 +02:00
|
|
|
];
|
|
|
|
|
2023-08-11 18:02:36 +02:00
|
|
|
# Enables DHCP on all ethernet and wireless LAN interfaces.
|
2023-08-01 16:31:44 +02:00
|
|
|
networking.useDHCP = lib.mkDefault true;
|
|
|
|
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
|
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
|
|
|
}
|