125 lines
2.4 KiB
Nix
125 lines
2.4 KiB
Nix
{
|
||
nixpkgs,
|
||
pkgs,
|
||
...
|
||
}:
|
||
|
||
{
|
||
imports = [
|
||
"${nixpkgs}/nixos/modules/installer/scan/not-detected.nix"
|
||
];
|
||
|
||
boot = {
|
||
initrd = {
|
||
availableKernelModules = [
|
||
"nvme"
|
||
"xhci_pci"
|
||
"thunderbolt"
|
||
"usbhid"
|
||
"sdhci_pci"
|
||
];
|
||
luks.devices."btrfs-crypt".device = "/dev/disk/by-uuid/f97bba41-e44d-4527-9e20-d09232a92323";
|
||
};
|
||
supportedFilesystems = [ "btrfs" ];
|
||
loader = {
|
||
efi.canTouchEfiVariables = true;
|
||
timeout = 0;
|
||
systemd-boot = {
|
||
enable = true;
|
||
consoleMode = "0";
|
||
editor = false;
|
||
};
|
||
};
|
||
kernelPackages = pkgs.linuxPackages_latest;
|
||
initrd.kernelModules = [ ];
|
||
kernelModules = [
|
||
"kvm-amd"
|
||
"amdgpu"
|
||
];
|
||
extraModulePackages = with pkgs.linuxPackages_latest; [ acpi_call ];
|
||
};
|
||
|
||
fileSystems = {
|
||
"/" = {
|
||
device = "none";
|
||
fsType = "tmpfs";
|
||
options = [
|
||
"defaults"
|
||
"size=512M"
|
||
"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"
|
||
];
|
||
neededForBoot = true;
|
||
};
|
||
"/nix" = {
|
||
device = "/dev/mapper/btrfs-crypt";
|
||
fsType = "btrfs";
|
||
options = [
|
||
"subvol=nix"
|
||
"noatime"
|
||
"compress=zstd"
|
||
];
|
||
neededForBoot = true;
|
||
};
|
||
"/snapshots" = {
|
||
device = "/dev/mapper/btrfs-crypt";
|
||
fsType = "btrfs";
|
||
options = [
|
||
"subvol=snapshots"
|
||
"noatime"
|
||
"compress=zstd"
|
||
"noexec"
|
||
];
|
||
neededForBoot = false;
|
||
};
|
||
"/boot" = {
|
||
device = "/dev/disk/by-uuid/12CE-A600";
|
||
fsType = "vfat";
|
||
options = [
|
||
"fmask=0022"
|
||
"dmask=0022"
|
||
];
|
||
};
|
||
};
|
||
|
||
services = {
|
||
upower.enable = true;
|
||
logind.extraConfig = ''
|
||
# don’t shutdown when power button is short-pressed
|
||
HandlePowerKey=suspend
|
||
'';
|
||
xserver.videoDrivers = [ "amdgpu" ];
|
||
};
|
||
|
||
hardware = {
|
||
cpu.amd.updateMicrocode = true;
|
||
graphics = {
|
||
enable = true;
|
||
enable32Bit = true;
|
||
};
|
||
bluetooth = {
|
||
enable = true;
|
||
powerOnBoot = true;
|
||
};
|
||
};
|
||
|
||
time.timeZone = "Europe/Berlin";
|
||
}
|