diff --git a/nixos/modules/config/pulseaudio.nix b/nixos/modules/config/pulseaudio.nix index bd80c8113483..b12ef2fe861d 100644 --- a/nixos/modules/config/pulseaudio.nix +++ b/nixos/modules/config/pulseaudio.nix @@ -6,6 +6,7 @@ with lib; let cfg = config.hardware.pulseaudio; + alsaCfg = config.sound; systemWide = cfg.enable && cfg.systemWide; nonSystemWide = cfg.enable && !cfg.systemWide; @@ -76,6 +77,7 @@ let ctl.!default { type pulse } + ${alsaCfg.extraConfig} ''); in { diff --git a/nixos/modules/services/audio/alsa.nix b/nixos/modules/services/audio/alsa.nix index 53786dbc6270..acf48d3c3d03 100644 --- a/nixos/modules/services/audio/alsa.nix +++ b/nixos/modules/services/audio/alsa.nix @@ -7,6 +7,8 @@ let inherit (pkgs) alsaUtils; + pulseaudioEnabled = config.hardware.pulseaudio.enable; + in { @@ -80,7 +82,7 @@ in environment.systemPackages = [ alsaUtils ]; - environment.etc = mkIf (config.sound.extraConfig != "") + environment.etc = mkIf (!pulseaudioEnabled && config.sound.extraConfig != "") [ { source = pkgs.writeText "asound.conf" config.sound.extraConfig; target = "asound.conf";