nixconfigs/nixos/hardware-configuration.nix

101 lines
2.6 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, modulesPath, ... }:
2018-09-25 23:09:53 +02:00
let
fsOptions = [ "noatime" "ssd" "space_cache" "compress=zstd" ];
in
2018-09-25 23:09:53 +02:00
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
(
builtins.fetchGit {
url = "https://github.com/NixOS/nixos-hardware";
rev = "a4bc66709604ab78abc575b60baa6d23ae027a59";
} + "/lenovo/thinkpad/t440s"
)
2018-09-25 23:09:53 +02:00
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [];
2018-09-25 23:09:53 +02:00
# encrypted partitions
boot.initrd.luks =
{
devices =
# allow discards on all devices
builtins.mapAttrs (name: val: val // {allowDiscards = true;})
{
"system".device = "/dev/disk/by-uuid/85154131-b2a8-4ef5-9d74-47429cb267ef";
"cryptswap".device = "/dev/disk/by-uuid/ac586df6-6332-4809-beb1-f51906a2adaa";
"ssd2".device = "/dev/disk/by-uuid/cadd4e1f-3642-4faa-8d4e-37dd85465df1";
};
reusePassphrases = true;
};
2018-09-25 23:09:53 +02:00
fileSystems."/" =
{
device = "/dev/disk/by-uuid/cb5998ae-cfc9-447f-8756-1ceaec6ca4c4";
2018-09-25 23:09:53 +02:00
fsType = "btrfs";
options = fsOptions ++ [ "subvol=nixos_root" ];
2018-09-25 23:09:53 +02:00
};
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/DED9-661B";
2018-09-25 23:09:53 +02:00
fsType = "vfat";
options = [ "discard" ];
2018-09-25 23:09:53 +02:00
};
fileSystems."/home" =
{
device = "/dev/disk/by-uuid/cb5998ae-cfc9-447f-8756-1ceaec6ca4c4";
fsType = "btrfs";
options = fsOptions ++ [ "subvol=home" ];
};
fileSystems."/var/tmp" =
{
device = "/dev/disk/by-uuid/cd6b8f25-c029-49a6-b326-656faec3ce15";
fsType = "btrfs";
options = fsOptions ++ [ "subvol=vartmp" ];
};
fileSystems."/var/log" =
{
device = "/dev/disk/by-uuid/cd6b8f25-c029-49a6-b326-656faec3ce15";
fsType = "btrfs";
options = fsOptions ++ [ "subvol=varlog" ];
};
fileSystems."/var/cache" =
{
device = "/dev/disk/by-uuid/cd6b8f25-c029-49a6-b326-656faec3ce15";
fsType = "btrfs";
options = fsOptions ++ [ "subvol=varcache" ];
};
boot.tmpOnTmpfs = true;
fileSystems."/tmp".fsType = "tmpfs";
2018-09-25 23:09:53 +02:00
swapDevices =
[
{ device = "/dev/disk/by-uuid/bf928178-4e92-4e7e-8df2-18fbd658eecf"; }
2018-09-25 23:09:53 +02:00
];
nix.settings.max-jobs = lib.mkDefault 4;
2018-09-25 23:09:53 +02:00
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.trackpoint = {
enable = true;
2021-02-17 00:14:07 +01:00
sensitivity = 180;
speed = 180;
};
# modesetting is always better than intel (legacy)
services.xserver.videoDrivers = [ "modesetting" ];
2018-09-25 23:09:53 +02:00
}