nixos/*: replace alsa* aliases
The attributes got renamed in PR #126440 and in some places this caused evaluation errors, e.g. the tarball job was saying (locally) > attribute 'alsaUtils' missing, at /build/source/nixos/modules/services/audio/alsa.nix:6:4 and I suspect that trunk-combined jobset's failure to evaluate was also caused.
This commit is contained in:
parent
5f16549ccf
commit
2ee781417e
|
@ -28,7 +28,7 @@ One can create a simple environment using a `shell.nix` like that:
|
||||||
name = "simple-x11-env";
|
name = "simple-x11-env";
|
||||||
targetPkgs = pkgs: (with pkgs;
|
targetPkgs = pkgs: (with pkgs;
|
||||||
[ udev
|
[ udev
|
||||||
alsaLib
|
alsa-lib
|
||||||
]) ++ (with pkgs.xorg;
|
]) ++ (with pkgs.xorg;
|
||||||
[ libX11
|
[ libX11
|
||||||
libXcursor
|
libXcursor
|
||||||
|
@ -36,7 +36,7 @@ One can create a simple environment using a `shell.nix` like that:
|
||||||
]);
|
]);
|
||||||
multiPkgs = pkgs: (with pkgs;
|
multiPkgs = pkgs: (with pkgs;
|
||||||
[ udev
|
[ udev
|
||||||
alsaLib
|
alsa-lib
|
||||||
]);
|
]);
|
||||||
runScript = "bash";
|
runScript = "bash";
|
||||||
}).env
|
}).env
|
||||||
|
|
|
@ -17,9 +17,9 @@ let
|
||||||
binary = "${getBin overriddenPackage}/bin/pulseaudio";
|
binary = "${getBin overriddenPackage}/bin/pulseaudio";
|
||||||
binaryNoDaemon = "${binary} --daemonize=no";
|
binaryNoDaemon = "${binary} --daemonize=no";
|
||||||
|
|
||||||
# Forces 32bit pulseaudio and alsaPlugins to be built/supported for apps
|
# Forces 32bit pulseaudio and alsa-plugins to be built/supported for apps
|
||||||
# using 32bit alsa on 64bit linux.
|
# using 32bit alsa on 64bit linux.
|
||||||
enable32BitAlsaPlugins = cfg.support32Bit && stdenv.isx86_64 && (pkgs.pkgsi686Linux.alsaLib != null && pkgs.pkgsi686Linux.libpulseaudio != null);
|
enable32BitAlsaPlugins = cfg.support32Bit && stdenv.isx86_64 && (pkgs.pkgsi686Linux.alsa-lib != null && pkgs.pkgsi686Linux.libpulseaudio != null);
|
||||||
|
|
||||||
|
|
||||||
myConfigFile =
|
myConfigFile =
|
||||||
|
@ -62,18 +62,18 @@ let
|
||||||
# plugin.
|
# plugin.
|
||||||
alsaConf = writeText "asound.conf" (''
|
alsaConf = writeText "asound.conf" (''
|
||||||
pcm_type.pulse {
|
pcm_type.pulse {
|
||||||
libs.native = ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_pulse.so ;
|
libs.native = ${pkgs.alsa-plugins}/lib/alsa-lib/libasound_module_pcm_pulse.so ;
|
||||||
${lib.optionalString enable32BitAlsaPlugins
|
${lib.optionalString enable32BitAlsaPlugins
|
||||||
"libs.32Bit = ${pkgs.pkgsi686Linux.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_pulse.so ;"}
|
"libs.32Bit = ${pkgs.pkgsi686Linux.alsa-plugins}/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 {
|
||||||
libs.native = ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_ctl_pulse.so ;
|
libs.native = ${pkgs.alsa-plugins}/lib/alsa-lib/libasound_module_ctl_pulse.so ;
|
||||||
${lib.optionalString enable32BitAlsaPlugins
|
${lib.optionalString enable32BitAlsaPlugins
|
||||||
"libs.32Bit = ${pkgs.pkgsi686Linux.alsaPlugins}/lib/alsa-lib/libasound_module_ctl_pulse.so ;"}
|
"libs.32Bit = ${pkgs.pkgsi686Linux.alsa-plugins}/lib/alsa-lib/libasound_module_ctl_pulse.so ;"}
|
||||||
}
|
}
|
||||||
ctl.!default {
|
ctl.!default {
|
||||||
type pulse
|
type pulse
|
||||||
|
|
|
@ -5,7 +5,7 @@ with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (pkgs) alsaUtils;
|
inherit (pkgs) alsa-utils;
|
||||||
|
|
||||||
pulseaudioEnabled = config.hardware.pulseaudio.enable;
|
pulseaudioEnabled = config.hardware.pulseaudio.enable;
|
||||||
|
|
||||||
|
@ -88,13 +88,13 @@ in
|
||||||
|
|
||||||
config = mkIf config.sound.enable {
|
config = mkIf config.sound.enable {
|
||||||
|
|
||||||
environment.systemPackages = [ alsaUtils ];
|
environment.systemPackages = [ alsa-utils ];
|
||||||
|
|
||||||
environment.etc = mkIf (!pulseaudioEnabled && config.sound.extraConfig != "")
|
environment.etc = mkIf (!pulseaudioEnabled && config.sound.extraConfig != "")
|
||||||
{ "asound.conf".text = config.sound.extraConfig; };
|
{ "asound.conf".text = config.sound.extraConfig; };
|
||||||
|
|
||||||
# ALSA provides a udev rule for restoring volume settings.
|
# ALSA provides a udev rule for restoring volume settings.
|
||||||
services.udev.packages = [ alsaUtils ];
|
services.udev.packages = [ alsa-utils ];
|
||||||
|
|
||||||
boot.kernelModules = optional config.sound.enableOSSEmulation "snd_pcm_oss";
|
boot.kernelModules = optional config.sound.enableOSSEmulation "snd_pcm_oss";
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ in
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
ExecStart = "${pkgs.coreutils}/bin/mkdir -p /var/lib/alsa";
|
ExecStart = "${pkgs.coreutils}/bin/mkdir -p /var/lib/alsa";
|
||||||
ExecStop = "${alsaUtils}/sbin/alsactl store --ignore";
|
ExecStop = "${alsa-utils}/sbin/alsactl store --ignore";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -115,16 +115,16 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
bindings = [
|
bindings = [
|
||||||
# "Mute" media key
|
# "Mute" media key
|
||||||
{ keys = [ 113 ]; events = [ "key" ]; command = "${alsaUtils}/bin/amixer -q set Master toggle"; }
|
{ keys = [ 113 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Master toggle"; }
|
||||||
|
|
||||||
# "Lower Volume" media key
|
# "Lower Volume" media key
|
||||||
{ keys = [ 114 ]; events = [ "key" "rep" ]; command = "${alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}- unmute"; }
|
{ keys = [ 114 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}- unmute"; }
|
||||||
|
|
||||||
# "Raise Volume" media key
|
# "Raise Volume" media key
|
||||||
{ keys = [ 115 ]; events = [ "key" "rep" ]; command = "${alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}+ unmute"; }
|
{ keys = [ 115 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}+ unmute"; }
|
||||||
|
|
||||||
# "Mic Mute" media key
|
# "Mic Mute" media key
|
||||||
{ keys = [ 190 ]; events = [ "key" ]; command = "${alsaUtils}/bin/amixer -q set Capture toggle"; }
|
{ keys = [ 190 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Capture toggle"; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ let
|
||||||
pcmPlugin = cfg.jackd.enable && cfg.alsa.enable;
|
pcmPlugin = cfg.jackd.enable && cfg.alsa.enable;
|
||||||
loopback = cfg.jackd.enable && cfg.loopback.enable;
|
loopback = cfg.jackd.enable && cfg.loopback.enable;
|
||||||
|
|
||||||
enable32BitAlsaPlugins = cfg.alsa.support32Bit && pkgs.stdenv.isx86_64 && pkgs.pkgsi686Linux.alsaLib != null;
|
enable32BitAlsaPlugins = cfg.alsa.support32Bit && pkgs.stdenv.isx86_64 && pkgs.pkgsi686Linux.alsa-lib != null;
|
||||||
|
|
||||||
umaskNeeded = versionOlder cfg.jackd.package.version "1.9.12";
|
umaskNeeded = versionOlder cfg.jackd.package.version "1.9.12";
|
||||||
bridgeNeeded = versionAtLeast cfg.jackd.package.version "1.9.12";
|
bridgeNeeded = versionAtLeast cfg.jackd.package.version "1.9.12";
|
||||||
|
@ -129,9 +129,9 @@ in {
|
||||||
(mkIf pcmPlugin {
|
(mkIf pcmPlugin {
|
||||||
sound.extraConfig = ''
|
sound.extraConfig = ''
|
||||||
pcm_type.jack {
|
pcm_type.jack {
|
||||||
libs.native = ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_jack.so ;
|
libs.native = ${pkgs.alsa-plugins}/lib/alsa-lib/libasound_module_pcm_jack.so ;
|
||||||
${lib.optionalString enable32BitAlsaPlugins
|
${lib.optionalString enable32BitAlsaPlugins
|
||||||
"libs.32Bit = ${pkgs.pkgsi686Linux.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_jack.so ;"}
|
"libs.32Bit = ${pkgs.pkgsi686Linux.alsa-plugins}/lib/alsa-lib/libasound_module_pcm_jack.so ;"}
|
||||||
}
|
}
|
||||||
pcm.!default {
|
pcm.!default {
|
||||||
@func getenv
|
@func getenv
|
||||||
|
@ -234,7 +234,7 @@ in {
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = [ cfg.jackd.package ];
|
systemPackages = [ cfg.jackd.package ];
|
||||||
etc."alsa/conf.d/50-jack.conf".source = "${pkgs.alsaPlugins}/etc/alsa/conf.d/50-jack.conf";
|
etc."alsa/conf.d/50-jack.conf".source = "${pkgs.alsa-plugins}/etc/alsa/conf.d/50-jack.conf";
|
||||||
variables.JACK_PROMISCUOUS_SERVER = "jackaudio";
|
variables.JACK_PROMISCUOUS_SERVER = "jackaudio";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ in
|
||||||
type = types.listOf (types.submodule bindingCfg);
|
type = types.listOf (types.submodule bindingCfg);
|
||||||
default = [];
|
default = [];
|
||||||
example = lib.literalExample ''
|
example = lib.literalExample ''
|
||||||
[ { keys = [ 113 ]; events = [ "key" ]; command = "''${pkgs.alsaUtils}/bin/amixer -q set Master toggle"; }
|
[ { keys = [ 113 ]; events = [ "key" ]; command = "''${pkgs.alsa-utils}/bin/amixer -q set Master toggle"; }
|
||||||
]
|
]
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
@ -46,7 +46,7 @@ import ./make-test-python.nix ({ pkgs, esr ? false, ... }: {
|
||||||
|
|
||||||
systemd.services.audio-recorder = {
|
systemd.services.audio-recorder = {
|
||||||
description = "Record NixOS test audio to /tmp/record.wav";
|
description = "Record NixOS test audio to /tmp/record.wav";
|
||||||
script = "${pkgs.alsaUtils}/bin/arecord -D recorder -f S16_LE -r48000 /tmp/record.wav";
|
script = "${pkgs.alsa-utils}/bin/arecord -D recorder -f S16_LE -r48000 /tmp/record.wav";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue