From e806cbf5b2ee84485c6497e065cc0d02e6a9decb Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 14 Apr 2018 14:01:30 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom/trivmix-service.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'custom/trivmix-service.nix') diff --git a/custom/trivmix-service.nix b/custom/trivmix-service.nix index 2957bf01..218d8d5f 100644 --- a/custom/trivmix-service.nix +++ b/custom/trivmix-service.nix @@ -57,24 +57,24 @@ let connect = (connectOut != []) || (connectIn != []) || (onConnect != []); mixerDeps = filter (x: any (hasPrefix (x + ":")) connectIn || any (hasPrefix (x + ":")) connectOut) (attrNames cfg); + + trivmixArgs = [ "--client" name "--level" initial ] + ++ optionals connect ["--run" connectScript] + ++ optional (adjustable && isNull group) "/dev/shm/mix/${name}/level" + ++ optional (! isNull group) "/dev/shm/mix/${group}/level"; in { wantedBy = [ "sound.target" ]; requires = [ "jack.service" ] ++ map (n: n + ".service") mixerDeps; - path = with pkgs; [ jack2Full ]; + path = with pkgs; [ jack2Full trivmix ]; serviceConfig = { Type = "notify"; - ExecStart = ''${pkgs.trivmix}/bin/trivmix --client ${name} \ - ${optionalString connect "--run ${connectScript}"} \ - "--level ${initial}" \ - ${optionalString (adjustable && isNull group) "/dev/shm/mix/${name}/level"} \ - ${optionalString (! isNull group) "/dev/shm/mix/${group}/level"} - ''; User = "jack"; Group = "audio"; Nice = "-10"; LimitRTPRIO = "95:95"; LimitMEMLOCK = "infinity"; }; + script = "trivmix ${escapeShellArgs trivmixArgs}"; }; in { options.services.trivmix = mkOption { -- cgit v1.2.3