1 { pkgs, lib, config, hostName, ... }:
5 ../../nixos/profiles/hardware/T480.nix
6 ../../nixos/profiles/zfs.nix
7 ../../nixos/profiles/zramSwap.nix
11 # Setting the machine-id avoids to reencrypt all credentials
12 # when reinstalling NixOS on a new drive.
13 # Manually generated with : uuidgen | tr -d -
14 environment.etc.machine-id.source = ./machine-id.clear;
16 # The 32-bit host id of the host, formatted as 8 hexadecimal characters.
17 # You should try to make this id unique among your hosts.
18 # Manually generated with : uuidgen | head -c8
19 networking.hostId = "e6eba6c4";
26 # Deprecated in nixos-24.11
27 #boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
30 canTouchEfiVariables = true;
31 efiSysMountPoint = "/boot1";
36 # Roughly 25MiB (initrd) + 9MiB (kernel) per configuration
37 configurationLimit = 6;
38 memtest86.enable = true;
40 extraInstallCommands = ''
42 cp -r /efiboot/efi1 /efiboot/efi2
45 # FIXME: needs https://github.com/NixOS/nixpkgs/pull/246897
49 boot.zfs.requestEncryptionCredentials = [ "${hostName}/root" ];
51 hardware.enableRedistributableFirmware = true;
53 services.udev.extraRules = ''
54 ACTION=="add", ATTRS{idVendor}=="5986", ATTRS{idProduct}=="1141", RUN="${pkgs.runtimeShell} -c 'echo 1 >/sys$devpath/remove'"
57 fileSystems."/boot1" =
59 device = "/dev/disk/by-partlabel/${hostName}_ssd1_boot";
61 options = [ "rw" "noexec" "nodev" "nofail" "X-mount.mkdir" "iocharset=iso8859-1" ];
65 device = "/dev/disk/by-partlabel/${hostName}_ssd1_swap";
68 cipher = "aes-xts-plain64";
69 source = "/dev/urandom";
74 boot.supportedFilesystems = [ "ntfs" "vfat" ];
78 device = "${hostName}/root";
80 options = [ "zfsutil" ];
84 device = "${hostName}/root/nix";
86 options = [ "X-mount.mkdir" "zfsutil" ];
90 device = "${hostName}/root/var";
92 options = [ "X-mount.mkdir" "zfsutil" ];
95 services.pipewire.jack.enable = true;