1 { config, lib, pkgs, ... }:
4 cfg = config.services.goxlr-utility;
11 services.goxlr-utility = {
16 Whether to enable goxlr-utility for controlling your TC-Helicon GoXLR or GoXLR Mini
19 package = mkPackageOption pkgs "goxlr-utility" { };
20 autoStart.xdg = mkOption {
22 type = with types; bool;
24 Start the daemon automatically using XDG autostart.
25 Sets `xdg.autostart.enable = true` if not already enabled.
33 goxlr-autostart = pkgs.stdenv.mkDerivation {
34 name = "autostart-goxlr-daemon";
38 mkdir -p $out/etc/xdg/autostart
39 cp ${cfg.package}/share/applications/goxlr-utility.desktop $out/etc/xdg/autostart/goxlr-daemon.desktop
40 chmod +w $out/etc/xdg/autostart/goxlr-daemon.desktop
41 echo "X-KDE-autostart-phase=2" >> $out/etc/xdg/autostart/goxlr-daemon.desktop
42 substituteInPlace $out/etc/xdg/autostart/goxlr-daemon.desktop \
43 --replace-fail goxlr-launcher goxlr-daemon
47 mkIf config.services.goxlr-utility.enable {
48 services.udev.packages = [ cfg.package ];
50 xdg.autostart.enable = mkIf cfg.autoStart.xdg true;
51 environment.systemPackages = mkIf cfg.autoStart.xdg
58 meta.maintainers = with maintainers; [ errnoh ];