diff --git a/desktop/general.nix b/desktop/general.nix index 604bbf1..9ebd4a0 100644 --- a/desktop/general.nix +++ b/desktop/general.nix @@ -36,7 +36,7 @@ in { default = true; example = false; }; - airplay.enable = (mkEnableOption "AirPlay sink device support") // { default = true; }; + airplay.enable = mkEnableOption "AirPlay sink device support"; }; graphics = { shaderCache = { diff --git a/desktop/multimedia.nix b/desktop/multimedia.nix index 08b3a5f..a288c7e 100644 --- a/desktop/multimedia.nix +++ b/desktop/multimedia.nix @@ -72,6 +72,40 @@ in { ResumeDelay = 4; }; }; + + services.pipewire.extraConfig.pipewire = { + "10-combined-outputs" = { + "context.modules" = [ + { + name = "libpipewire-module-combine-stream"; + args = { + "combine.mode" = "sink"; + "node.name" = "combine_sink"; + "node.description" = "Sortie combinée"; + "combine.latency-compensate" = true; + "combine.props" = { + "audio.position" = [ "FL" "FR" ]; + }; + "stream.props" = {}; + "stream.rules" = [ + { + matches = [ + # any of the items in matches needs to match, if one does, + # actions are emited. + { + # all keys must match the value. ! negates. ~ starts regex. + #node.name = "~alsa_input.*" + "media.class" = "Audio/Sink"; + } + ]; + actions.create-stream = {}; + } + ]; + }; + } + ]; + }; + }; environment.etc = { "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = '' @@ -82,43 +116,6 @@ in { ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" } ''; - "pipewire/pipewire.conf.d/combined-outputs.conf".text = '' - context.modules = [ - { name = libpipewire-module-combine-stream - args = { - combine.mode = sink - node.name = "combine_sink" - node.description = "Sortie combinée" - combine.latency-compensate = true - combine.props = { - audio.position = [ FL FR ] - } - stream.props = { - } - stream.rules = [ - { - matches = [ - # any of the items in matches needs to match, if one does, - # actions are emited. - { - # all keys must match the value. ! negates. ~ starts regex. - #node.name = "~alsa_input.*" - media.class = "Audio/Sink" - } - ] - actions = { - create-stream = { - #combine.audio.position = [ FL FR ] - #audio.position = [ FL FR ] - } - } - } - ] - } - } - ] - ''; - }; security.rtkit.enable = true; # Real-time support for pipewire @@ -135,7 +132,7 @@ in { }; serviceConfig = { ExecStart = [ - "${pkgs.pipewire}/bin/pipewire -c ${conf}" + "${getBin config.services.pipewire.package}/bin/pipewire -c ${conf}" ]; Type = "simple"; Restart = "on-failure";