summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bragi.nix3
-rw-r--r--custom/trivmix-service.nix4
2 files changed, 6 insertions, 1 deletions
diff --git a/bragi.nix b/bragi.nix
index 111254d2..ad7fe3cd 100644
--- a/bragi.nix
+++ b/bragi.nix
@@ -167,6 +167,9 @@ in rec {
167 speakers1 = { connectOut = "system:playback_8"; connectIn = "outnode1:out"; group = "speakers"; initial = "0"; }; 167 speakers1 = { connectOut = "system:playback_8"; connectIn = "outnode1:out"; group = "speakers"; initial = "0"; };
168 }; 168 };
169 169
170 systemd.services.mpdmix0.requiredBy = [ "mpd.service" ];
171 systemd.services.mpdmix1.requiredBy = [ "mpd.service" ];
172
170 services.mpd = { 173 services.mpd = {
171 enable = true; 174 enable = true;
172 musicDirectory = "/media/odin/music"; 175 musicDirectory = "/media/odin/music";
diff --git a/custom/trivmix-service.nix b/custom/trivmix-service.nix
index a0c46db6..985ded80 100644
--- a/custom/trivmix-service.nix
+++ b/custom/trivmix-service.nix
@@ -56,9 +56,11 @@ let
56 ''; 56 '';
57 57
58 connect = (connectOut != []) || (connectIn != []) || (onConnect != []); 58 connect = (connectOut != []) || (connectIn != []) || (onConnect != []);
59
60 mixerDeps = filter (x: any (hasPrefix (x + ":")) connectIn || any (hasPrefix (x + ":")) connectOut) (attrNames cfg);
59 in { 61 in {
60 wantedBy = [ "sound.target" ]; 62 wantedBy = [ "sound.target" ];
61 requires = [ "jack.service" ]; 63 requires = [ "jack.service" ] ++ map (n: n + ".service") mixerDeps;
62 path = with pkgs; [ jack2Full ]; 64 path = with pkgs; [ jack2Full ];
63 serviceConfig = { 65 serviceConfig = {
64 Type = "simple"; 66 Type = "simple";