/
hardware-configuration.nix
68 lines (55 loc) · 1.75 KB
/
hardware-configuration.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
networking.hostId = "a28d9fb2";
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.kernelParams = [ "mem_sleep_default=deep" ];
boot.initrd.luks.devices = {
cryptkey = {
device = "/dev/disk/by-uuid/b1f400d6-abc8-4bcd-b813-8299f4904c26";
};
cryptroot = {
device = "/dev/disk/by-uuid/42ebff49-eb4d-4f7e-a1ab-9cb6d8b71eb2";
keyFile = "/dev/mapper/cryptkey";
};
cryptswap = {
device = "/dev/disk/by-uuid/0512a685-d190-438d-9e26-db1381514ae5";
keyFile = "/dev/mapper/cryptkey";
};
};
boot.initrd.postMountCommands = ''
# Don't keep the cryptkey available all the time.
cryptsetup close /dev/mapper/cryptkey
'';
boot.initrd.postDeviceCommands = lib.mkAfter ''
zfs rollback -r rpool/local/blank-root@blank
'';
fileSystems."/" =
{ device = "rpool/local/blank-root";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "rpool/safe/home";
fsType = "zfs";
};
fileSystems."/nix" =
{ device = "rpool/local/nix";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/0EDF-0FA9";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/8265fee0-7541-41b7-92a2-e059f34a68ae"; }
];
nix.maxJobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}