3
0
Fork 0
forked from mirrors/nixpkgs

* Add a module to enable PulseAudio. It causes all ALSA applications

to be rerouted to PulseAudio.

  Note that this is distinct from the already existing module
  ‘services/audio/pulseaudio.nix’ that provides a system-wide
  PulseAudio daemon, which is usually not what you want.

svn path=/nixos/trunk/; revision=27958
This commit is contained in:
Eelco Dolstra 2011-07-26 01:51:56 +00:00
parent a1df35a590
commit 7bdaedb465
3 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,47 @@
{ config, pkgs, ... }:
with pkgs.lib;
{
options = {
hardware.pulseaudio.enable = mkOption {
default = false;
description = ''
Whether to enable the PulseAudio sound server.
'';
};
};
config = mkIf config.hardware.pulseaudio.enable {
environment.systemPackages =
[ pkgs.pulseaudio pkgs.alsaPlugins ];
environment.etc =
[ # Write an /etc/asound.conf that causes all ALSA applications to
# be re-routed to the PulseAudio server through ALSA's Pulse
# plugin.
{ target = "asound.conf";
source = pkgs.writeText "asound.conf"
''
pcm.!default {
type pulse
hint.description "Default Audio Device (via PulseAudio)"
}
ctl.!default {
type pulse
}
'';
}
];
# Ensure that the ALSA Pulse plugin appears in ALSA's search path.
environment.pathsToLink = [ "lib/alsa-lib" ];
};
}

View file

@ -7,6 +7,7 @@
./config/no-x-libs.nix
./config/nsswitch.nix
./config/power-management.nix
./config/pulseaudio.nix
./config/shells.nix
./config/swap.nix
./config/system-path.nix

View file

@ -117,6 +117,11 @@ in
# Phonon backends.
pkgs.kde4.phonon_backend_gstreamer
pkgs.gst_all.gstPluginsBase
pkgs.gst_all.gstPluginsGood
pkgs.gst_all.gstPluginsUgly
pkgs.gst_all.gstPluginsBad
pkgs.gst_all.gstFfmpeg # for mp3 playback
pkgs.gst_all.gstreamer # needed?
# Miscellaneous runtime dependencies.
pkgs.kde4.qt4 # needed for qdbus
@ -138,6 +143,8 @@ in
services.hal = mkIf (!isKDE47) { enable = true; };
services.udisks = mkIf isKDE47 { enable = true; };
services.upower = mkIf isKDE47 { enable = true; };
hardware.pulseaudio = mkIf isKDE47 { enable = true; };
};