From 7a7d781e6a031a35bec296c2861734835eb155e3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 1 Aug 2011 13:26:51 +0000 Subject: [PATCH] * Allow the PulseAudio server to be overriden. svn path=/nixos/trunk/; revision=28112 --- modules/config/pulseaudio.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/modules/config/pulseaudio.nix b/modules/config/pulseaudio.nix index 8f2227461b52..943b300b9a7b 100644 --- a/modules/config/pulseaudio.nix +++ b/modules/config/pulseaudio.nix @@ -15,13 +15,23 @@ let cfg = config.hardware.pulseaudio; in ''; }; + hardware.pulseaudio.package = mkOption { + default = pkgs.pulseaudio; + example = "pkgs.pulseaudio.override { jackaudioSupport = true; }"; + description = '' + The PulseAudio derivation to use. This can be used to enable + features (such as JACK support) that are not enabled in the + default PulseAudio in Nixpkgs. + ''; + }; + }; config = mkIf cfg.enable { environment.systemPackages = - [ pkgs.pulseaudio ]; + [ cfg.package ]; environment.etc = mkAlways ( [ # Create pulse/client.conf even if PulseAudio is disabled so @@ -31,6 +41,9 @@ let cfg = config.hardware.pulseaudio; in source = pkgs.writeText "client.conf" '' autospawn=${if cfg.enable then "yes" else "no"} + ${optionalString cfg.enable '' + daemon-binary=${cfg.package}/bin/pulseaudio + ''} ''; } @@ -61,11 +74,11 @@ let cfg = config.hardware.pulseaudio; in } { target = "pulse/default.pa"; - source = "${pkgs.pulseaudio}/etc/pulse/default.pa"; + source = "${cfg.package}/etc/pulse/default.pa"; } { target = "pulse/system.pa"; - source = "${pkgs.pulseaudio}/etc/pulse/system.pa"; + source = "${cfg.package}/etc/pulse/system.pa"; } ]);