zaphyra's git: nixfiles

zaphyra's nixfiles

commit 6cea19acda06fa562b4234ac6ae3ec43fae4303a
parent a4e4547435949ce145e8874f84750454be31afea
Author: Hannah Izzie Gesser <hannah@totient.eu>
Date: Tue, 7 Oct 2025 10:02:44 +0200

Add thunderbolt module
1 file changed, 24 insertions(+), 0 deletions(-)
diff --git a/config/nixos/modules/hardware/thunderbolt.nix b/config/nixos/modules/hardware/thunderbolt.nix
@@ -0,0 +1,24 @@
+{
+  config,
+  lib,
+  povSelf,
+  ...
+}:
+let
+  inherit (lib) types;
+  cfg = lib.getAttrFromPath povSelf config;
+
+in
+{
+
+  options.enable = {
+    type = types.bool;
+    default = false;
+  };
+
+  config = lib.mkIf cfg.enable {
+    boot.initrd.availableKernelModules = [ "thunderbolt" ];
+    services.hardware.bolt.enable = true;
+  };
+
+}