]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/courge/hardware.nix
xmonad: rofi: import more environment variables
[julm/julm-nix.git] / hosts / courge / hardware.nix
1 {
2 pkgs,
3 lib,
4 config,
5 hostName,
6 ...
7 }:
8 with lib;
9 {
10 imports = [
11 ../../nixos/profiles/hardware/T480.nix
12 ../../nixos/profiles/zfs.nix
13 ../../nixos/profiles/zramSwap.nix
14 #hardware/nvidia.nix
15 ];
16
17 # Setting the machine-id avoids to reencrypt all credentials
18 # when reinstalling NixOS on a new drive.
19 # Manually generated with : uuidgen | tr -d -
20 environment.etc.machine-id.source = ./machine-id.clear;
21
22 # The 32-bit host id of the host, formatted as 8 hexadecimal characters.
23 # You should try to make this id unique among your hosts.
24 # Manually generated with : uuidgen | head -c8
25 networking.hostId = "e6eba6c4";
26
27 boot.kernelParams = [
28 #"boot.trace"
29 "boot.shell_on_fail"
30 #"boot.debug1"
31 ];
32 # Deprecated in nixos-24.11
33 #boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
34 boot.loader = {
35 efi = {
36 canTouchEfiVariables = true;
37 efiSysMountPoint = "/boot1";
38 };
39 systemd-boot = {
40 enable = true;
41 #editor = false;
42 # Roughly 25MiB (initrd) + 9MiB (kernel) per configuration
43 configurationLimit = 6;
44 memtest86.enable = true;
45 /*
46 extraInstallCommands = ''
47 rm -rf /efiboot/efi2
48 cp -r /efiboot/efi1 /efiboot/efi2
49 '';
50 */
51 # FIXME: needs https://github.com/NixOS/nixpkgs/pull/246897
52 #mirroredBoots = [ ];
53 };
54 };
55 boot.zfs.requestEncryptionCredentials = [ "${hostName}/root" ];
56
57 hardware.enableRedistributableFirmware = true;
58 # Disable IR camera
59 services.udev.extraRules = ''
60 ACTION=="add", ATTRS{idVendor}=="5986", ATTRS{idProduct}=="1141", RUN="${pkgs.runtimeShell} -c 'echo 1 >/sys$devpath/remove'"
61 '';
62
63 fileSystems."/boot1" = {
64 device = "/dev/disk/by-partlabel/${hostName}_ssd1_boot";
65 fsType = "vfat";
66 options = [
67 "rw"
68 "noexec"
69 "nodev"
70 "nofail"
71 "X-mount.mkdir"
72 "iocharset=iso8859-1"
73 ];
74 };
75 swapDevices = [
76 {
77 device = "/dev/disk/by-partlabel/${hostName}_ssd1_swap";
78 randomEncryption = {
79 enable = true;
80 cipher = "aes-xts-plain64";
81 source = "/dev/urandom";
82 };
83 }
84 ];
85
86 boot.supportedFilesystems = [
87 "ntfs"
88 "vfat"
89 ];
90
91 fileSystems."/" = {
92 device = "${hostName}/root";
93 fsType = "zfs";
94 options = [ "zfsutil" ];
95 };
96 fileSystems."/nix" = {
97 device = "${hostName}/root/nix";
98 fsType = "zfs";
99 options = [
100 "X-mount.mkdir"
101 "zfsutil"
102 ];
103 };
104 fileSystems."/var" = {
105 device = "${hostName}/root/var";
106 fsType = "zfs";
107 options = [
108 "X-mount.mkdir"
109 "zfsutil"
110 ];
111 };
112
113 services.pipewire.jack.enable = true;
114
115 }