2023-04-13 20:34:56 +02:00
|
|
|
{ config, lib, pkgs, modulesPath, inputs, ... }:
|
2018-09-25 23:09:53 +02:00
|
|
|
|
2020-04-10 14:53:21 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
fsOptions = [ "noatime" "ssd" "space_cache" "compress=zstd" ];
|
|
|
|
in
|
2018-09-25 23:09:53 +02:00
|
|
|
{
|
|
|
|
imports =
|
2020-04-05 21:53:45 +02:00
|
|
|
[
|
2023-04-13 19:28:45 +02:00
|
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
2023-04-13 20:34:56 +02:00
|
|
|
(inputs.nixos-hardware + "/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" ];
|
2020-04-05 21:53:45 +02:00
|
|
|
boot.extraModulePackages = [];
|
2018-09-25 23:09:53 +02:00
|
|
|
|
2020-04-10 14:53:21 +02:00
|
|
|
# encrypted partitions
|
|
|
|
boot.initrd.luks =
|
|
|
|
{
|
|
|
|
devices =
|
2020-06-06 01:40:46 +02:00
|
|
|
# allow discards on all devices
|
|
|
|
builtins.mapAttrs (name: val: val // {allowDiscards = true;})
|
2020-04-10 14:53:21 +02:00
|
|
|
{
|
|
|
|
"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."/" =
|
2020-04-05 21:53:45 +02:00
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/cb5998ae-cfc9-447f-8756-1ceaec6ca4c4";
|
2018-09-25 23:09:53 +02:00
|
|
|
fsType = "btrfs";
|
2020-04-10 14:53:21 +02:00
|
|
|
options = fsOptions ++ [ "subvol=nixos_root" ];
|
2018-09-25 23:09:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems."/boot" =
|
2020-04-05 21:53:45 +02:00
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/DED9-661B";
|
2018-09-25 23:09:53 +02:00
|
|
|
fsType = "vfat";
|
2019-11-22 20:02:07 +01:00
|
|
|
options = [ "discard" ];
|
2018-09-25 23:09:53 +02:00
|
|
|
};
|
|
|
|
|
2018-10-12 11:08:52 +02:00
|
|
|
fileSystems."/home" =
|
2020-04-05 21:53:45 +02:00
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/cb5998ae-cfc9-447f-8756-1ceaec6ca4c4";
|
2018-10-12 11:08:52 +02:00
|
|
|
fsType = "btrfs";
|
2020-04-10 14:53:21 +02:00
|
|
|
options = fsOptions ++ [ "subvol=home" ];
|
2018-10-12 11:08:52 +02:00
|
|
|
};
|
|
|
|
|
2020-04-10 14:53:21 +02:00
|
|
|
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" ];
|
|
|
|
};
|
|
|
|
|
2023-06-04 21:24:31 +02:00
|
|
|
boot.tmp.useTmpfs = true;
|
2020-04-10 14:53:21 +02:00
|
|
|
fileSystems."/tmp".fsType = "tmpfs";
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
swapDevices =
|
2020-04-05 21:53:45 +02:00
|
|
|
[
|
|
|
|
{ device = "/dev/disk/by-uuid/bf928178-4e92-4e7e-8df2-18fbd658eecf"; }
|
2018-09-25 23:09:53 +02:00
|
|
|
];
|
|
|
|
|
2022-12-02 20:00:39 +01:00
|
|
|
nix.settings.max-jobs = lib.mkDefault 4;
|
2018-09-25 23:09:53 +02:00
|
|
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
2019-05-18 15:50:54 +02:00
|
|
|
|
|
|
|
hardware.trackpoint = {
|
|
|
|
enable = true;
|
2021-02-17 00:14:07 +01:00
|
|
|
sensitivity = 180;
|
|
|
|
speed = 180;
|
2019-05-18 15:50:54 +02:00
|
|
|
};
|
2021-12-02 23:20:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
# modesetting is always better than intel (legacy)
|
|
|
|
services.xserver.videoDrivers = [ "modesetting" ];
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
}
|