diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-14 14:01:30 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-14 14:01:30 +0200 |
commit | e806cbf5b2ee84485c6497e065cc0d02e6a9decb (patch) | |
tree | 58f92ce3a570095163e04019fbdef1627dbe9715 /custom | |
parent | 6426ebf9c2de6cca54be8a4e891c9d71fdea7f6c (diff) | |
download | nixos-e806cbf5b2ee84485c6497e065cc0d02e6a9decb.tar nixos-e806cbf5b2ee84485c6497e065cc0d02e6a9decb.tar.gz nixos-e806cbf5b2ee84485c6497e065cc0d02e6a9decb.tar.bz2 nixos-e806cbf5b2ee84485c6497e065cc0d02e6a9decb.tar.xz nixos-e806cbf5b2ee84485c6497e065cc0d02e6a9decb.zip |
…
Diffstat (limited to 'custom')
-rw-r--r-- | custom/trivmix-service.nix | 14 |
1 files changed, 7 insertions, 7 deletions
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 | |||
57 | connect = (connectOut != []) || (connectIn != []) || (onConnect != []); | 57 | connect = (connectOut != []) || (connectIn != []) || (onConnect != []); |
58 | 58 | ||
59 | mixerDeps = filter (x: any (hasPrefix (x + ":")) connectIn || any (hasPrefix (x + ":")) connectOut) (attrNames cfg); | 59 | mixerDeps = filter (x: any (hasPrefix (x + ":")) connectIn || any (hasPrefix (x + ":")) connectOut) (attrNames cfg); |
60 | |||
61 | trivmixArgs = [ "--client" name "--level" initial ] | ||
62 | ++ optionals connect ["--run" connectScript] | ||
63 | ++ optional (adjustable && isNull group) "/dev/shm/mix/${name}/level" | ||
64 | ++ optional (! isNull group) "/dev/shm/mix/${group}/level"; | ||
60 | in { | 65 | in { |
61 | wantedBy = [ "sound.target" ]; | 66 | wantedBy = [ "sound.target" ]; |
62 | requires = [ "jack.service" ] ++ map (n: n + ".service") mixerDeps; | 67 | requires = [ "jack.service" ] ++ map (n: n + ".service") mixerDeps; |
63 | path = with pkgs; [ jack2Full ]; | 68 | path = with pkgs; [ jack2Full trivmix ]; |
64 | serviceConfig = { | 69 | serviceConfig = { |
65 | Type = "notify"; | 70 | Type = "notify"; |
66 | ExecStart = ''${pkgs.trivmix}/bin/trivmix --client ${name} \ | ||
67 | ${optionalString connect "--run ${connectScript}"} \ | ||
68 | "--level ${initial}" \ | ||
69 | ${optionalString (adjustable && isNull group) "/dev/shm/mix/${name}/level"} \ | ||
70 | ${optionalString (! isNull group) "/dev/shm/mix/${group}/level"} | ||
71 | ''; | ||
72 | User = "jack"; | 71 | User = "jack"; |
73 | Group = "audio"; | 72 | Group = "audio"; |
74 | Nice = "-10"; | 73 | Nice = "-10"; |
75 | LimitRTPRIO = "95:95"; | 74 | LimitRTPRIO = "95:95"; |
76 | LimitMEMLOCK = "infinity"; | 75 | LimitMEMLOCK = "infinity"; |
77 | }; | 76 | }; |
77 | script = "trivmix ${escapeShellArgs trivmixArgs}"; | ||
78 | }; | 78 | }; |
79 | in { | 79 | in { |
80 | options.services.trivmix = mkOption { | 80 | options.services.trivmix = mkOption { |