From 9783bde2f4bfa5bcf65423925520118c38e08300 Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Tue, 15 Jul 2025 19:16:41 +0100 Subject: [PATCH] nixos/sheep-net: init --- nixos/modules/hardware/sheep-net.nix | 35 ++++++++++++++++++++++++++++ nixos/modules/module-list.nix | 1 + 2 files changed, 36 insertions(+) create mode 100644 nixos/modules/hardware/sheep-net.nix diff --git a/nixos/modules/hardware/sheep-net.nix b/nixos/modules/hardware/sheep-net.nix new file mode 100644 index 000000000000..3df6f5840efa --- /dev/null +++ b/nixos/modules/hardware/sheep-net.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.hardware.sheep_net; +in +{ + options.hardware.sheep_net = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Enables sheep_net udev rules, ensures 'sheep_net' group exists, and adds + sheep-net to boot.kernelModules and boot.extraModulePackages + ''; + }; + }; + config = lib.mkIf cfg.enable { + services.udev.extraRules = '' + KERNEL=="sheep_net", GROUP="sheep_net" + ''; + boot.kernelModules = [ + "sheep_net" + ]; + boot.extraModulePackages = [ + config.boot.kernelPackages.sheep-net + ]; + users.groups.sheep_net = { }; + }; + meta.maintainers = with lib.maintainers; [ matthewcroughan ]; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d0831c02e6d7..250313621698 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -103,6 +103,7 @@ ./hardware/sata.nix ./hardware/sensor/hddtemp.nix ./hardware/sensor/iio.nix + ./hardware/sheep-net.nix ./hardware/steam-hardware.nix ./hardware/system-76.nix ./hardware/tuxedo-drivers.nix