129 lines
2.8 KiB
Nix
129 lines
2.8 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
modulesPath,
|
|
nixos-hardware,
|
|
...
|
|
}:
|
|
|
|
{
|
|
imports = [
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
|
nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen4
|
|
];
|
|
|
|
console.keyMap = "de";
|
|
services.xserver.xkb.layout = "de";
|
|
|
|
boot = {
|
|
initrd = {
|
|
availableKernelModules = [
|
|
"nvme"
|
|
"xhci_pci"
|
|
"thunderbolt"
|
|
"usbhid"
|
|
];
|
|
luks.devices."btrfs-crypt".device = "/dev/disk/by-uuid/d4f76a5f-bf47-4a03-b7dc-3a1a7f83c030";
|
|
kernelModules = [ ];
|
|
};
|
|
supportedFilesystems = [ "btrfs" ];
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
|
kernelModules = [ "kvm-amd" ];
|
|
|
|
loader = {
|
|
systemd-boot.enable = true;
|
|
efi.canTouchEfiVariables = true;
|
|
};
|
|
};
|
|
|
|
fileSystems = {
|
|
"/" = {
|
|
device = "none";
|
|
fsType = "tmpfs";
|
|
options = [
|
|
"defaults"
|
|
"size=1G"
|
|
"mode=755"
|
|
];
|
|
};
|
|
"/tmp" = {
|
|
device = "/dev/mapper/btrfs-crypt";
|
|
fsType = "btrfs";
|
|
options = [
|
|
"subvol=tmp"
|
|
"noatime"
|
|
"compress=zstd"
|
|
];
|
|
neededForBoot = true;
|
|
};
|
|
"/persist" = {
|
|
device = "/dev/mapper/btrfs-crypt";
|
|
fsType = "btrfs";
|
|
options = [
|
|
"subvol=persist"
|
|
"noatime"
|
|
"compress=zstd:6"
|
|
];
|
|
neededForBoot = true;
|
|
};
|
|
"/nix" = {
|
|
device = "/dev/mapper/btrfs-crypt";
|
|
fsType = "btrfs";
|
|
options = [
|
|
"subvol=nix"
|
|
"noatime"
|
|
"compress=zstd:6"
|
|
];
|
|
neededForBoot = true;
|
|
};
|
|
"/snapshots" = {
|
|
device = "/dev/mapper/btrfs-crypt";
|
|
fsType = "btrfs";
|
|
options = [
|
|
"subvol=snapshots"
|
|
"noatime"
|
|
"compress=zstd:6"
|
|
];
|
|
neededForBoot = false;
|
|
};
|
|
"/boot" = {
|
|
device = "/dev/disk/by-uuid/4FE7-0CC9";
|
|
fsType = "vfat";
|
|
options = [
|
|
"fmask=0022"
|
|
"dmask=0022"
|
|
];
|
|
};
|
|
};
|
|
|
|
swapDevices = [ ];
|
|
powerManagement = {
|
|
enable = true;
|
|
cpuFreqGovernor = "powersave";
|
|
};
|
|
|
|
services = {
|
|
upower.enable = true;
|
|
};
|
|
|
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
# still possible to use this option, but it's recommended to use it in conjunction
|
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
|
# networking.useDHCP = lib.mkDefault true;
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
hardware = {
|
|
cpu.amd.updateMicrocode = true;
|
|
bluetooth.enable = true;
|
|
};
|
|
time = {
|
|
timeZone = "Europe/Berlin";
|
|
hardwareClockInLocalTime = true;
|
|
};
|
|
networking.timeServers = [
|
|
"ntp1.zih.tu-dresden.de"
|
|
"ntp2.zih.tu-dresden.de"
|
|
];
|
|
}
|