mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/modules/services/audio/alsa.nix: fix evaluation
https://github.com/NixOS/nixpkgs/issues/2732
This commit is contained in:
parent
78618e12d3
commit
c18775837c
1 changed files with 7 additions and 9 deletions
|
@ -7,10 +7,6 @@ let
|
||||||
|
|
||||||
inherit (pkgs) alsaUtils;
|
inherit (pkgs) alsaUtils;
|
||||||
|
|
||||||
soundState = "/var/lib/alsa/asound.state";
|
|
||||||
|
|
||||||
configPath = "asound.conf";
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -39,7 +35,7 @@ in
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = '''';
|
default = "";
|
||||||
example = ''
|
example = ''
|
||||||
defaults.pcm.!card 3
|
defaults.pcm.!card 3
|
||||||
'';
|
'';
|
||||||
|
@ -59,10 +55,12 @@ in
|
||||||
|
|
||||||
environment.systemPackages = [ alsaUtils ];
|
environment.systemPackages = [ alsaUtils ];
|
||||||
|
|
||||||
environment.etc = [ { source = config.sound.extraConfig;
|
environment.etc = mkIf (config.sound.extraConfig != "")
|
||||||
target = configPath;
|
[
|
||||||
}
|
{ source = pkgs.writeText "asound.conf" config.sound.extraConfig;
|
||||||
];
|
target = "asound.conf";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
# 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 = [ alsaUtils ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue