nixos/hardware/chn-PC.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

2023-05-28 23:49:58 +08:00
{ config, lib, pkgs, modulesPath, ... }:
{
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
nixpkgs.config.allowUnfree = true;
hardware = {
enableAllFirmware = true;
cpu.intel.updateMicrocode = true;
};
fileSystems = {
"/" = {
device = "/dev/mapper/root";
fsType = "btrfs";
2023-05-30 21:21:46 +08:00
options = [ "subvol=@root,compress-force=zstd:15" ];
2023-05-28 23:49:58 +08:00
};
"/swap" = {
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "subvol=@swap" ];
};
2023-05-28 23:49:58 +08:00
"/boot" = {
device = "/dev/disk/by-uuid/50DE-B72A";
fsType = "vfat";
};
};
swapDevices = [ { device = "/swap/swap"; } ];
2023-05-28 23:49:58 +08:00
boot = {
loader = {
timeout = 30;
2023-05-28 23:49:58 +08:00
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd = {
luks.devices.root = {
device = "/dev/disk/by-partuuid/49fe75e3-bd94-4c75-9b21-2c77a1f74c4e";
header = "/dev/disk/by-partuuid/c341ca23-bb14-4927-9b31-a9dcc959d0f5";
allowDiscards = true;
};
systemd.enable = true;
availableKernelModules =
[
"ahci" "i915" "intel_cstate" "nvidia" "nvidia_drm" "nvidia_modeset" "nvidia_uvm" "nvme" "sr_mod"
"tuxedo-keyboard" "usb_storage" "virtio_blk" "virtio_pci" "xhci_pci"
];
2023-05-28 23:49:58 +08:00
};
kernelPackages = pkgs.linuxPackages_xanmod_latest;
kernelModules = [ "kvm-intel" ];
kernelParams = [ "delayacct" "acpi_osi=Linux" "resume_offset=19145984" ];
resumeDevice = "/dev/mapper/root";
extraModulePackages = with config.boot.kernelPackages; [ cpupower xone xpadneo tuxedo-keyboard ];
2023-06-02 19:46:37 +08:00
extraModprobeConfig = "options kvm_intel nested=1";
2023-05-28 23:49:58 +08:00
};
}