From f92e689c31f828f430419832cc51109060e64e97 Mon Sep 17 00:00:00 2001 From: workflow <4farlion@gmail.com> Date: Fri, 22 Nov 2024 11:48:27 +0000 Subject: [PATCH] feat(sound): fix systemd-service startup timing --- home/sound-levels-maintainer/default.nix | 2 ++ home/virtual-cable/default.nix | 3 +++ 2 files changed, 5 insertions(+) diff --git a/home/sound-levels-maintainer/default.nix b/home/sound-levels-maintainer/default.nix index 8ac72b4..c2c5c84 100644 --- a/home/sound-levels-maintainer/default.nix +++ b/home/sound-levels-maintainer/default.nix @@ -15,7 +15,9 @@ in { systemd.user.services.sound-levels-maintainer = { Unit = { + After = ["obs-mic.service"]; Description = "Maintain input/output gain/volume levels"; + Requires = ["obs-mic.service"]; }; Install.WantedBy = ["default.target"]; Service = { diff --git a/home/virtual-cable/default.nix b/home/virtual-cable/default.nix index 834ea0c..131f59d 100644 --- a/home/virtual-cable/default.nix +++ b/home/virtual-cable/default.nix @@ -6,11 +6,14 @@ in { systemd.user.services.obs-mic = { Unit = { + After = ["wireplumber.service"]; Description = "Set up virtualMic and virtualSpeaker for OBS"; + Requires = ["wireplumber.service"]; }; Install.WantedBy = ["default.target"]; Service = { Environment = "PATH=$PATH:/run/current-system/sw/bin"; + ExecStartPre = "${pkgs.coreutils}/bin/sleep 5"; # TODO: Find a better way to wait for WirePlumber to fully start ExecStart = "${obs-mic}/bin/obs-mic"; Type = "oneshot"; };