nixos-config/hosts/thinkpad/hardware-configuration.nix

95 lines
2.3 KiB
Nix
Raw Normal View History

2023-11-24 09:57:15 +01:00
{ pkgs, config, lib, modulesPath, ... }:
2022-12-18 17:01:34 +01:00
{
imports =
2022-12-19 18:01:40 +01:00
[
(modulesPath + "/installer/scan/not-detected.nix")
2022-12-18 17:01:34 +01:00
];
2023-11-24 09:57:15 +01:00
environment.systemPackages = with pkgs; [
nvme-cli
intel-gpu-tools
2024-03-25 19:06:25 +01:00
nvtopPackages.intel
2023-11-24 09:57:15 +01:00
lm_sensors
pciutils
];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
kernelModules = [ ];
systemd.enable = true;
luks.devices."luksroot" = {
device = "/dev/disk/by-uuid/6b89181c-71e0-4e84-8523-2456d3e28400";
allowDiscards = true;
};
luks.devices."luksswap" = {
device = "/dev/disk/by-uuid/4a5fd2d9-1b37-4895-a24b-835a9cd4063e";
};
};
kernelModules = [ "kvm-intel" ];
zfs = {
allowHibernation = true;
forceImportRoot = false;
};
2023-02-28 20:48:06 +01:00
};
2022-12-18 17:01:34 +01:00
2023-01-28 14:53:23 +01:00
2024-03-25 19:06:25 +01:00
# fileSystems."/" =
# { device = "/dev/disk/by-uuid/43e42607-bc44-45de-a2c1-a09a4e34daf1";
# fsType = "btrfs";
# options = [ "subvol=root" ];
# };
fileSystems."/home" =
2024-03-25 19:06:25 +01:00
{
device = "/dev/disk/by-uuid/43e42607-bc44-45de-a2c1-a09a4e34daf1";
fsType = "btrfs";
options = [ "subvol=home" "compress=zstd" ];
2023-01-28 14:53:23 +01:00
};
fileSystems."/nix" =
2024-03-25 19:06:25 +01:00
{
device = "/dev/disk/by-uuid/43e42607-bc44-45de-a2c1-a09a4e34daf1";
fsType = "btrfs";
2024-03-25 19:06:25 +01:00
options = [ "subvol=nix" "compress=zstd" "noatime" ];
2023-01-28 14:53:23 +01:00
};
fileSystems."/var/log" =
2024-03-25 19:06:25 +01:00
{
device = "/dev/disk/by-uuid/43e42607-bc44-45de-a2c1-a09a4e34daf1";
fsType = "btrfs";
options = [ "subvol=log" "compress=zstd" ];
2023-02-16 22:08:44 +01:00
};
fileSystems."/var/lib" =
2024-03-25 19:06:25 +01:00
{
device = "/dev/disk/by-uuid/43e42607-bc44-45de-a2c1-a09a4e34daf1";
fsType = "btrfs";
options = [ "subvol=lib" "compress=zstd" ];
2022-12-18 17:01:34 +01:00
};
2024-03-25 19:06:25 +01:00
fileSystems."/" =
{
device = "tmpfs";
fsType = "tmpfs";
options = [ "mode=755" ];
};
2022-12-18 17:01:34 +01:00
fileSystems."/boot" =
2022-12-19 18:01:40 +01:00
{
device = "/dev/disk/by-uuid/12CE-A600";
2022-12-18 17:01:34 +01:00
fsType = "vfat";
};
2023-02-28 20:48:06 +01:00
swapDevices =
[{ device = "/dev/disk/by-uuid/1dd20f07-877c-4ee5-bef5-5e8c6ebe7927"; }];
boot.resumeDevice = "/dev/disk/by-uuid/1dd20f07-877c-4ee5-bef5-5e8c6ebe7927";
2022-12-18 17:01:34 +01:00
2023-01-28 14:53:23 +01:00
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
2024-04-22 15:24:37 +02:00
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
2022-12-18 17:01:34 +01:00
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}