2023-10-07 02:18:22 +02:00
|
|
|
{ config, lib, pkgs, modulesPath, ... }: {
|
|
|
|
imports =
|
|
|
|
[
|
|
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
|
|
|
];
|
|
|
|
|
|
|
|
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "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=2G" "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";
|
|
|
|
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";
|
|
|
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
2023-10-17 17:11:07 +02:00
|
|
|
|
|
|
|
# Disable jet engine
|
|
|
|
services.thinkfan = {
|
|
|
|
enable = true;
|
|
|
|
levels = [
|
|
|
|
[ 0 0 70 ]
|
|
|
|
[ 1 65 75 ]
|
|
|
|
[ 2 70 80 ]
|
|
|
|
[ 3 75 85 ]
|
|
|
|
[ 6 80 90 ]
|
|
|
|
[ 7 90 95 ]
|
|
|
|
[ "level auto" 95 32767 ]
|
|
|
|
];
|
|
|
|
};
|
|
|
|
boot.extraModprobeConfig = ''
|
|
|
|
options thinkpad_acpi fan_control=1 experimental=1
|
|
|
|
'';
|
2023-10-07 02:18:22 +02:00
|
|
|
}
|