]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/courge/hardware.nix
courge: install
[julm/julm-nix.git] / hosts / courge / hardware.nix
1 { pkgs, lib, config, hostName, ... }:
2 with lib;
3 {
4 imports = [
5 ../../nixos/profiles/hardware/T480.nix
6 ../../nixos/profiles/zfs.nix
7 ../../nixos/profiles/zramSwap.nix
8 #hardware/nvidia.nix
9 ];
10
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;
15
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";
20
21 boot.kernelParams = [
22 #"boot.trace"
23 "boot.shell_on_fail"
24 #"boot.debug1"
25 ];
26 boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
27 boot.loader = {
28 efi = {
29 canTouchEfiVariables = true;
30 efiSysMountPoint = "/boot1";
31 };
32 systemd-boot = {
33 enable = true;
34 #editor = false;
35 # Roughly 25MiB (initrd) + 9MiB (kernel) per configuration
36 configurationLimit = 6;
37 memtest86.enable = true;
38 /*
39 extraInstallCommands = ''
40 rm -rf /efiboot/efi2
41 cp -r /efiboot/efi1 /efiboot/efi2
42 '';
43 */
44 # FIXME: needs https://github.com/NixOS/nixpkgs/pull/246897
45 #mirroredBoots = [ ];
46 };
47 };
48 boot.zfs.requestEncryptionCredentials = [ "${hostName}/root" ];
49
50 hardware.enableRedistributableFirmware = true;
51
52 fileSystems."/boot1" =
53 {
54 device = "/dev/disk/by-partlabel/${hostName}_ssd1_boot";
55 fsType = "vfat";
56 options = [ "rw" "noexec" "nodev" "nofail" "X-mount.mkdir" "iocharset=iso8859-1" ];
57 };
58 swapDevices = [
59 {
60 device = "/dev/disk/by-partlabel/${hostName}_ssd1_swap";
61 randomEncryption = {
62 enable = true;
63 cipher = "aes-xts-plain64";
64 source = "/dev/urandom";
65 };
66 }
67 ];
68
69 boot.supportedFilesystems = [ "ntfs" "vfat" ];
70
71 fileSystems."/" =
72 {
73 device = "${hostName}/root";
74 fsType = "zfs";
75 options = [ "zfsutil" ];
76 };
77 fileSystems."/nix" =
78 {
79 device = "${hostName}/root/nix";
80 fsType = "zfs";
81 options = [ "X-mount.mkdir" "zfsutil" ];
82 };
83 fileSystems."/var" =
84 {
85 device = "${hostName}/root/var";
86 fsType = "zfs";
87 options = [ "X-mount.mkdir" "zfsutil" ];
88 };
89
90 services.pipewire.jack.enable = true;
91
92 }