audio: fix pipewire config under newest nixos-unstable
This commit is contained in:
parent
f50629267b
commit
9877ddad93
|
@ -3,6 +3,13 @@
|
||||||
let
|
let
|
||||||
cfg = config.c3d2.audioStreaming;
|
cfg = config.c3d2.audioStreaming;
|
||||||
isGraphical = config.services.xserver.enable || config.services.xserver.displayManager.defaultSession != null;
|
isGraphical = config.services.xserver.enable || config.services.xserver.displayManager.defaultSession != null;
|
||||||
|
|
||||||
|
hasConfigPackages = options.services.pipewire?configPackages;
|
||||||
|
zeroconfConfig = builtins.toJSON {
|
||||||
|
"context.modules" = [ {
|
||||||
|
"name" = "libpipewire-module-zeroconf-discover";
|
||||||
|
} ];
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
@ -10,10 +17,12 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg {
|
config = lib.mkIf cfg {
|
||||||
environment.etc."pipewire/pipewire.conf.d/zeroconf.conf".text = builtins.toJSON {
|
environment.etc = lib.mkIf (!hasConfigPackages) {
|
||||||
"context.modules" = [ {
|
"pipewire/pipewire.conf.d/zeroconf.conf".text = builtins.toJSON {
|
||||||
"name" = "libpipewire-module-zeroconf-discover";
|
"context.modules" = [ {
|
||||||
} ];
|
"name" = "libpipewire-module-zeroconf-discover";
|
||||||
|
} ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = lib.mkIf isGraphical (with pkgs; [
|
environment.systemPackages = lib.mkIf isGraphical (with pkgs; [
|
||||||
|
@ -67,7 +76,14 @@ in
|
||||||
"${nssmdns}" = true;
|
"${nssmdns}" = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
pipewire.pulse.enable = true;
|
pipewire = lib.optionalAttrs hasConfigPackages {
|
||||||
|
configPackages = [ (pkgs.runCommand "zeroconf.conf" { } ''
|
||||||
|
mkdir -p $out/share/pipewire/pipewire.conf.d/
|
||||||
|
ln -s ${pkgs.writeText "zeroconf.conf" zeroconfConfig} $out/share/pipewire/pipewire.conf.d/zeroconf.conf
|
||||||
|
'') ];
|
||||||
|
}// {
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# makes avahi unreliable
|
# makes avahi unreliable
|
||||||
resolved.extraConfig = ''
|
resolved.extraConfig = ''
|
||||||
|
|
Loading…
Reference in New Issue