diff --git a/modules/config/pulseaudio.nix b/modules/config/pulseaudio.nix new file mode 100644 index 00000000000..55270c29037 --- /dev/null +++ b/modules/config/pulseaudio.nix @@ -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" ]; + + }; + +} diff --git a/modules/module-list.nix b/modules/module-list.nix index d7fc7e2ec87..c2c8d4ee7ab 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -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 diff --git a/modules/services/x11/desktop-managers/kde4.nix b/modules/services/x11/desktop-managers/kde4.nix index 9cfbee8ecc7..5b68114135a 100644 --- a/modules/services/x11/desktop-managers/kde4.nix +++ b/modules/services/x11/desktop-managers/kde4.nix @@ -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; }; };