bash: alias ju
[julm/julm-nix.git] / hosts / courge / hardware.nix
index 8a1dd773217531a25bf50439c2b55463d9169e52..6dc3b8537e1b7a3a4be2ccb8f402ee5f638de9fd 100644 (file)
@@ -1,9 +1,11 @@
-{ pkgs, config, hostName, ... }:
+{ pkgs, lib, config, hostName, ... }:
+with lib;
 {
   imports = [
     ../../nixos/profiles/hardware/T480.nix
     ../../nixos/profiles/zfs.nix
     ../../nixos/profiles/zramSwap.nix
+    #hardware/nvidia.nix
   ];
 
   # Setting the machine-id avoids to reencrypt all credentials
   # Manually generated with : uuidgen | head -c8
   networking.hostId = "e6eba6c4";
 
+  boot.kernelParams = [
+    #"boot.trace"
+    "boot.shell_on_fail"
+    #"boot.debug1"
+  ];
   boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
-
   boot.loader = {
     efi = {
       canTouchEfiVariables = true;
-      efiSysMountPoint = "/boot/efi";
+      efiSysMountPoint = "/boot1";
     };
     systemd-boot = {
       enable = true;
       # FIXME: needs https://github.com/NixOS/nixpkgs/pull/246897
       #mirroredBoots = [ ];
     };
-
-    #generationsDir.copyKernels = true;
   };
+  boot.zfs.requestEncryptionCredentials = [ "${hostName}/root" ];
 
   hardware.enableRedistributableFirmware = true;
+  # Disable IR camera
+  services.udev.extraRules = ''
+    ACTION=="add", ATTRS{idVendor}=="5986", ATTRS{idProduct}=="1141", RUN="${pkgs.runtimeShell} -c 'echo 1 >/sys$devpath/remove'"
+  '';
 
-  fileSystems."/boot/efi" =
+  fileSystems."/boot1" =
     {
-      device = "/dev/disk/by-partlabel/${hostName}_ssd_efi";
+      device = "/dev/disk/by-partlabel/${hostName}_ssd1_boot";
       fsType = "vfat";
       options = [ "rw" "noexec" "nodev" "nofail" "X-mount.mkdir" "iocharset=iso8859-1" ];
     };
   swapDevices = [
     {
-      device = "/dev/disk/by-partlabel/${hostName}_ssd_swap";
+      device = "/dev/disk/by-partlabel/${hostName}_ssd1_swap";
       randomEncryption = {
         enable = true;
         cipher = "aes-xts-plain64";