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

82 lines
1.8 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
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
2023-08-02 18:04:26 +02:00
fileSystems."/nix" =
2023-01-28 14:53:23 +01:00
{
2023-08-02 18:04:26 +02:00
device = "rpool/nixos/nix";
fsType = "zfs";
2023-01-28 14:53:23 +01:00
};
fileSystems."/var/lib" =
{
2023-08-02 18:04:26 +02:00
device = "rpool/nixos/var/lib";
fsType = "zfs";
2023-01-28 14:53:23 +01:00
};
fileSystems."/var/log" =
{
2023-08-02 18:04:26 +02:00
device = "rpool/nixos/var/log";
fsType = "zfs";
2023-02-16 22:08:44 +01:00
};
2023-08-02 18:04:26 +02:00
fileSystems."/home" =
{
device = "rpool/nixos/home";
fsType = "zfs";
};
fileSystems."/" =
2023-02-16 22:08:44 +01:00
{
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
{
2023-08-02 18:04:26 +02:00
device = "/dev/disk/by-uuid/DF86-7611";
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";
2022-12-18 17:01:34 +01:00
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}