pulseaudio: Add support for 32bit alsa apps on 64bit systems.
This commit is contained in:
parent
ab8ef63ff4
commit
0c8ad65560
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, pkgs_i686, ... }:
|
||||||
|
|
||||||
with pkgs;
|
with pkgs;
|
||||||
with lib;
|
with lib;
|
||||||
|
@ -10,6 +10,10 @@ let
|
||||||
systemWide = cfg.enable && cfg.systemWide;
|
systemWide = cfg.enable && cfg.systemWide;
|
||||||
nonSystemWide = cfg.enable && !cfg.systemWide;
|
nonSystemWide = cfg.enable && !cfg.systemWide;
|
||||||
|
|
||||||
|
# Forces 32bit pulseaudio and alsaPlugins to be built/supported for apps
|
||||||
|
# using 32bit alsa on 64bit linux.
|
||||||
|
enable32BitAlsaPlugins = stdenv.isx86_64 && (pkgs_i686.alsaLib != null);
|
||||||
|
|
||||||
ids = config.ids;
|
ids = config.ids;
|
||||||
|
|
||||||
uid = ids.uids.pulseaudio;
|
uid = ids.uids.pulseaudio;
|
||||||
|
@ -28,21 +32,25 @@ let
|
||||||
# Write an /etc/asound.conf that causes all ALSA applications to
|
# Write an /etc/asound.conf that causes all ALSA applications to
|
||||||
# be re-routed to the PulseAudio server through ALSA's Pulse
|
# be re-routed to the PulseAudio server through ALSA's Pulse
|
||||||
# plugin.
|
# plugin.
|
||||||
alsaConf = writeText "asound.conf" ''
|
alsaConf = writeText "asound.conf" (''
|
||||||
pcm_type.pulse {
|
pcm_type.pulse {
|
||||||
lib ${alsaPlugins}/lib/alsa-lib/libasound_module_pcm_pulse.so
|
libs.native = ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_pulse.so ;
|
||||||
|
${lib.optionalString enable32BitAlsaPlugins
|
||||||
|
"libs.32Bit = ${pkgs_i686.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_pulse.so ;"}
|
||||||
}
|
}
|
||||||
pcm.!default {
|
pcm.!default {
|
||||||
type pulse
|
type pulse
|
||||||
hint.description "Default Audio Device (via PulseAudio)"
|
hint.description "Default Audio Device (via PulseAudio)"
|
||||||
}
|
}
|
||||||
ctl_type.pulse {
|
ctl_type.pulse {
|
||||||
lib ${alsaPlugins}/lib/alsa-lib/libasound_module_ctl_pulse.so
|
libs.native = ${alsaPlugins}/lib/alsa-lib/libasound_module_ctl_pulse.so ;
|
||||||
|
${lib.optionalString enable32BitAlsaPlugins
|
||||||
|
"libs.32Bit = ${pkgs_i686.alsaPlugins}/lib/alsa-lib/libasound_module_ctl_pulse.so ;"}
|
||||||
}
|
}
|
||||||
ctl.!default {
|
ctl.!default {
|
||||||
type pulse
|
type pulse
|
||||||
}
|
}
|
||||||
'';
|
'');
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
|
@ -116,7 +124,10 @@ in {
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf cfg.enable {
|
(mkIf cfg.enable {
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [
|
||||||
|
cfg.package
|
||||||
|
(lib.optional enable32BitAlsaPlugins pkgs_i686.pulseaudio)
|
||||||
|
];
|
||||||
|
|
||||||
environment.etc = singleton {
|
environment.etc = singleton {
|
||||||
target = "asound.conf";
|
target = "asound.conf";
|
||||||
|
|
Loading…
Reference in New Issue