diff options
-rw-r--r-- | bragi.nix | 2 | ||||
-rw-r--r-- | custom/trivmix-service.nix | 36 |
2 files changed, 20 insertions, 18 deletions
@@ -1,7 +1,7 @@ | |||
1 | { config, pkgs, ... }: | 1 | { config, pkgs, ... }: |
2 | 2 | ||
3 | let | 3 | let |
4 | trivmixService = opts: pkgs.callPackage ./custom/trivmix-service.nix opts; | 4 | trivmixService = opts: (pkgs.callPackage ./custom/trivmix-service.nix opts).out; |
5 | thermoprint-servant = (pkgs.callPackage ./custom/thermoprint {}).thermoprint-servant; | 5 | thermoprint-servant = (pkgs.callPackage ./custom/thermoprint {}).thermoprint-servant; |
6 | inherit (pkgs) lib; | 6 | inherit (pkgs) lib; |
7 | in rec { | 7 | in rec { |
diff --git a/custom/trivmix-service.nix b/custom/trivmix-service.nix index 04f1634b..e9120f88 100644 --- a/custom/trivmix-service.nix +++ b/custom/trivmix-service.nix | |||
@@ -24,22 +24,24 @@ let | |||
24 | ''; | 24 | ''; |
25 | inherit (stdenv.lib) optionalString; | 25 | inherit (stdenv.lib) optionalString; |
26 | in { | 26 | in { |
27 | wantedBy = [ "sound.target" ]; | 27 | out = { |
28 | requires = [ "jack.service" ]; | 28 | wantedBy = [ "sound.target" ]; |
29 | before = [ "mpd.service" ]; | 29 | requires = [ "jack.service" ]; |
30 | serviceConfig = { | 30 | before = [ "mpd.service" ]; |
31 | Type = "simple"; | 31 | serviceConfig = { |
32 | ExecStart = ''${trivmix}/bin/trivmix --client ${name} \ | 32 | Type = "simple"; |
33 | ${optionalString connect "--run ${connectScript}"} \ | 33 | ExecStart = ''${trivmix}/bin/trivmix --client ${name} \ |
34 | ${optionalString (! isNull run) "--run ${run}"} \ | 34 | ${optionalString connect "--run ${connectScript}"} \ |
35 | ${optionalString (! isNull initial) "--level ${initial}"} \ | 35 | ${optionalString (! isNull run) "--run ${run}"} \ |
36 | /dev/shm/mix/${name}/level \ | 36 | ${optionalString (! isNull initial) "--level ${initial}"} \ |
37 | ${optionalString (! isNull group) "/dev/shm/mix/${group}/level"} | 37 | /dev/shm/mix/${name}/level \ |
38 | ''; | 38 | ${optionalString (! isNull group) "/dev/shm/mix/${group}/level"} |
39 | User = "jack"; | 39 | ''; |
40 | Group = "audio"; | 40 | User = "jack"; |
41 | Nice = "-10"; | 41 | Group = "audio"; |
42 | LimitRTPRIO = "95:95"; | 42 | Nice = "-10"; |
43 | LimitMEMLOCK = "infinity"; | 43 | LimitRTPRIO = "95:95"; |
44 | LimitMEMLOCK = "infinity"; | ||
45 | }; | ||
44 | }; | 46 | }; |
45 | } | 47 | } |