]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/courge/hardware.nix
aubergine: clean code
[julm/julm-nix.git] / hosts / courge / hardware.nix
1 { pkgs, config, hostName, ... }:
2 {
3 imports = [
4 ../../nixos/profiles/hardware/T480.nix
5 ../../nixos/profiles/zfs.nix
6 ../../nixos/profiles/zramSwap.nix
7 ];
8
9 # Setting the machine-id avoids to reencrypt all credentials
10 # when reinstalling NixOS on a new drive.
11 # Manually generated with : uuidgen | tr -d -
12 environment.etc.machine-id.source = ./machine-id.clear;
13
14 # The 32-bit host id of the host, formatted as 8 hexadecimal characters.
15 # You should try to make this id unique among your hosts.
16 # Manually generated with : uuidgen | head -c8
17 networking.hostId = "e6eba6c4";
18
19 boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
20
21 boot.loader = {
22 efi = {
23 canTouchEfiVariables = true;
24 efiSysMountPoint = "/boot/efi";
25 };
26 systemd-boot = {
27 enable = true;
28 #editor = false;
29 # Roughly 25MiB (initrd) + 9MiB (kernel) per configuration
30 configurationLimit = 6;
31 memtest86.enable = true;
32 /*
33 extraInstallCommands = ''
34 rm -rf /efiboot/efi2
35 cp -r /efiboot/efi1 /efiboot/efi2
36 '';
37 */
38 # FIXME: needs https://github.com/NixOS/nixpkgs/pull/246897
39 #mirroredBoots = [ ];
40 };
41
42 #generationsDir.copyKernels = true;
43 };
44
45 hardware.enableRedistributableFirmware = true;
46
47 fileSystems."/boot/efi" =
48 {
49 device = "/dev/disk/by-partlabel/${hostName}_ssd_efi";
50 fsType = "vfat";
51 options = [ "rw" "noexec" "nodev" "nofail" "X-mount.mkdir" "iocharset=iso8859-1" ];
52 };
53 swapDevices = [
54 {
55 device = "/dev/disk/by-partlabel/${hostName}_ssd_swap";
56 randomEncryption = {
57 enable = true;
58 cipher = "aes-xts-plain64";
59 source = "/dev/urandom";
60 };
61 }
62 ];
63
64 boot.supportedFilesystems = [ "ntfs" "vfat" ];
65
66 fileSystems."/" =
67 {
68 device = "${hostName}/root";
69 fsType = "zfs";
70 options = [ "zfsutil" ];
71 };
72 fileSystems."/nix" =
73 {
74 device = "${hostName}/root/nix";
75 fsType = "zfs";
76 options = [ "X-mount.mkdir" "zfsutil" ];
77 };
78 fileSystems."/var" =
79 {
80 device = "${hostName}/root/var";
81 fsType = "zfs";
82 options = [ "X-mount.mkdir" "zfsutil" ];
83 };
84
85 services.pipewire.jack.enable = true;
86
87 }