diff options
author | Erno Hopearuoho <erno.hopearuoho@gmail.com> | 2023-08-18 17:28:28 +0300 |
---|---|---|
committer | Doron Behar <doron.behar@gmail.com> | 2023-08-19 17:16:41 +0300 |
commit | 3748c8b483f6922566df37d2f87620d2e6ee7fb7 (patch) | |
tree | d564d144f296b24486f2a411ca089c34c863d3c7 /nixos/modules/services/audio | |
parent | a9365b9c098abf299942893f2d756b1c812ba890 (diff) | |
download | nixlib-3748c8b483f6922566df37d2f87620d2e6ee7fb7.tar nixlib-3748c8b483f6922566df37d2f87620d2e6ee7fb7.tar.gz nixlib-3748c8b483f6922566df37d2f87620d2e6ee7fb7.tar.bz2 nixlib-3748c8b483f6922566df37d2f87620d2e6ee7fb7.tar.lz nixlib-3748c8b483f6922566df37d2f87620d2e6ee7fb7.tar.xz nixlib-3748c8b483f6922566df37d2f87620d2e6ee7fb7.tar.zst nixlib-3748c8b483f6922566df37d2f87620d2e6ee7fb7.zip |
goxlr-utility: init module
Diffstat (limited to 'nixos/modules/services/audio')
-rw-r--r-- | nixos/modules/services/audio/goxlr-utility.nix | 48 |
1 files changed, 48 insertions, 0 deletions
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 ]; +} |