2023-08-22 20:05:09 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.goxlr-utility;
|
|
|
|
in
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
|
|
|
services.goxlr-utility = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
type = types.bool;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2023-08-22 20:05:09 +00:00
|
|
|
Whether to enable goxlr-utility for controlling your TC-Helicon GoXLR or GoXLR Mini
|
|
|
|
'';
|
|
|
|
};
|
2024-01-02 11:29:13 +00:00
|
|
|
package = mkPackageOption pkgs "goxlr-utility" { };
|
2023-08-22 20:05:09 +00:00
|
|
|
autoStart.xdg = mkOption {
|
|
|
|
default = true;
|
|
|
|
type = with types; bool;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2023-08-22 20:05:09 +00:00
|
|
|
Start the daemon automatically using XDG autostart.
|
|
|
|
Sets `xdg.autostart.enable = true` if not already enabled.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
config =
|
|
|
|
let
|
|
|
|
goxlr-autostart = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "autostart-goxlr-daemon";
|
|
|
|
priority = 5;
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/etc/xdg/autostart
|
|
|
|
cp ${cfg.package}/share/applications/goxlr-utility.desktop $out/etc/xdg/autostart/goxlr-daemon.desktop
|
|
|
|
chmod +w $out/etc/xdg/autostart/goxlr-daemon.desktop
|
|
|
|
echo "X-KDE-autostart-phase=2" >> $out/etc/xdg/autostart/goxlr-daemon.desktop
|
|
|
|
substituteInPlace $out/etc/xdg/autostart/goxlr-daemon.desktop \
|
|
|
|
--replace-fail goxlr-launcher goxlr-daemon
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
mkIf config.services.goxlr-utility.enable {
|
2023-08-22 20:05:09 +00:00
|
|
|
services.udev.packages = [ cfg.package ];
|
|
|
|
|
|
|
|
xdg.autostart.enable = mkIf cfg.autoStart.xdg true;
|
|
|
|
environment.systemPackages = mkIf cfg.autoStart.xdg
|
|
|
|
[
|
|
|
|
cfg.package
|
2024-09-19 14:19:46 +00:00
|
|
|
goxlr-autostart
|
2023-08-22 20:05:09 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
meta.maintainers = with maintainers; [ errnoh ];
|
|
|
|
}
|