From 3748c8b483f6922566df37d2f87620d2e6ee7fb7 Mon Sep 17 00:00:00 2001 From: Erno Hopearuoho Date: Fri, 18 Aug 2023 17:28:28 +0300 Subject: [PATCH] goxlr-utility: init module --- nixos/modules/module-list.nix | 1 + .../modules/services/audio/goxlr-utility.nix | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 nixos/modules/services/audio/goxlr-utility.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 5852843b8021..1144fe520419 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -319,6 +319,7 @@ ./services/audio/botamusique.nix ./services/audio/gmediarender.nix ./services/audio/gonic.nix + ./services/audio/goxlr-utility.nix ./services/audio/hqplayerd.nix ./services/audio/icecast.nix ./services/audio/jack.nix diff --git a/nixos/modules/services/audio/goxlr-utility.nix b/nixos/modules/services/audio/goxlr-utility.nix new file mode 100644 index 000000000000..b719de875c7f --- /dev/null +++ b/nixos/modules/services/audio/goxlr-utility.nix @@ -0,0 +1,48 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.services.goxlr-utility; +in + +with lib; +{ + + options = { + services.goxlr-utility = { + enable = mkOption { + default = false; + type = types.bool; + description = lib.mdDoc '' + Whether to enable goxlr-utility for controlling your TC-Helicon GoXLR or GoXLR Mini + ''; + }; + package = mkPackageOptionMD pkgs "goxlr-utility" { }; + autoStart.xdg = mkOption { + default = true; + type = with types; bool; + description = lib.mdDoc '' + Start the daemon automatically using XDG autostart. + Sets `xdg.autostart.enable = true` if not already enabled. + ''; + }; + }; + }; + + config = mkIf config.services.goxlr-utility.enable + { + services.udev.packages = [ cfg.package ]; + + xdg.autostart.enable = mkIf cfg.autoStart.xdg true; + environment.systemPackages = mkIf cfg.autoStart.xdg + [ + cfg.package + (pkgs.makeAutostartItem + { + name = "goxlr-utility"; + package = cfg.package; + }) + ]; + }; + + meta.maintainers = with maintainers; [ errnoh ]; +}