From 91015fe19605cdf09ab33125a55286c612455449 Mon Sep 17 00:00:00 2001 From: Hubert Jasudowicz Date: Mon, 23 May 2022 20:56:46 +0200 Subject: [PATCH] nixos/saleae-logic: init --- .../from_md/release-notes/rl-2211.section.xml | 6 +++-- .../manual/release-notes/rl-2211.section.md | 3 ++- nixos/modules/hardware/saleae-logic.nix | 25 +++++++++++++++++++ nixos/modules/module-list.nix | 1 + 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 nixos/modules/hardware/saleae-logic.nix diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml index 8bbb8665219a..55c20427cfde 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml @@ -92,8 +92,10 @@ - Please remove this line when you add the first item since - docbook requires the section to be non-empty + A new module was added for the Saleae Logic device family, + providing the options + hardware.saleae-logic.enable and + hardware.saleae-logic.package. diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md index 5dc8e958c896..97ecb725dfb5 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -44,5 +44,6 @@ In addition to numerous new and upgraded packages, this release has the followin ## Other Notable Changes {#sec-release-22.11-notable-changes} -- Please remove this line when you add the first item since docbook requires the section to be non-empty +* A new module was added for the Saleae Logic device family, providing the options `hardware.saleae-logic.enable` and `hardware.saleae-logic.package`. + diff --git a/nixos/modules/hardware/saleae-logic.nix b/nixos/modules/hardware/saleae-logic.nix new file mode 100644 index 000000000000..a3810d640c48 --- /dev/null +++ b/nixos/modules/hardware/saleae-logic.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.hardware.saleae-logic; +in +{ + options.hardware.saleae-logic = { + enable = lib.mkEnableOption "udev rules for Saleae Logic devices"; + + package = lib.mkOption { + type = lib.types.package; + default = pkgs.saleae-logic-2; + defaultText = lib.literalExpression "pkgs.saleae-logic-2"; + description = '' + Saleae Logic package to use. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + services.udev.packages = [ cfg.package ]; + }; + + meta.maintainers = with lib.maintainers; [ chivay ]; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index f7357036d69d..81b386999703 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -73,6 +73,7 @@ ./hardware/printers.nix ./hardware/raid/hpsa.nix ./hardware/rtl-sdr.nix + ./hardware/saleae-logic.nix ./hardware/steam-hardware.nix ./hardware/system-76.nix ./hardware/tuxedo-keyboard.nix