ctucx.git: nixfiles

ctucx' nixfiles

commit 554cfb158fb0f31fbe9fd298b835a2cf30388008
parent a1f0bf974c9f4c5cb25988d936823ccc1d0c36e4
Author: Leah (ctucx) <leah@ctu.cx>
Date: Mon, 21 Feb 2022 23:17:39 +0100

machines/{coladose,currywurst}: enable thunderbolt networking support
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/configurations/thunderbolt.nix b/configurations/thunderbolt.nix
@@ -0,0 +1,15 @@
+{ pkgs, ... }:
+
+{
+
+  boot.kernelModules         = [ "thunderbolt-net"];
+  environment.systemPackages = [ pkgs.bolt ];
+
+  services = {
+    hardware.bolt.enable = true;
+    udev.extraRules      = ''
+      ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"
+    '';
+  };
+
+}
diff --git a/machines/coladose/configuration.nix b/machines/coladose/configuration.nix
@@ -4,6 +4,7 @@
   imports = [
     ./hardware-configuration.nix
     ../../configurations/mobile-device.nix
+    ../../configurations/thunderbolt.nix
     ../../configurations/common.nix
     ../../configurations/bluetooth.nix
     ../../configurations/desktop-sway.nix

@@ -21,7 +22,7 @@
     consoleLogLevel               = 3;
     kernel.sysctl."vm.swappiness" = 0;
     kernel.sysctl."kernel/sysrq"  = 1;
-    kernelModules                 = [ "tpm-rng" ];
+    kernelModules                 = [ "tpm-rng" "thunderbolt-net" ];
     kernelParams = [
       "quiet"
       "scsi_mod.use_blk_mq=1"
diff --git a/machines/currywurst/configuration.nix b/machines/currywurst/configuration.nix
@@ -4,6 +4,7 @@
   imports = [
     ./hardware-configuration.nix
     ../../configurations/mobile-device.nix
+    ../../configurations/thunderbolt.nix
     ../../configurations/common.nix
     ../../configurations/bluetooth.nix
     ../../configurations/desktop-sway.nix

@@ -21,7 +22,7 @@
     kernel.sysctl."vm.swappiness" = 0;
     kernel.sysctl."kernel/sysrq"  = 1;
     kernelPackages                = pkgs.linuxKernel.packages.linux_5_16;
-    kernelModules                 = [ "tpm-rng" ];
+    kernelModules                 = [ "tpm-rng" "thunderbolt-net" ];
     extraModulePackages           = [
       pkgs.linuxKernel.packages.linux_5_16.acpi_call
       (pkgs.callPackage ./xmm7360.nix { kernel = pkgs.linux_5_16; })