diff options
author | Peter Simons <simons@cryp.to> | 2014-05-23 19:20:16 +0200 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2014-05-23 19:20:49 +0200 |
commit | c18775837cf7122e2448539b738beea62c96af1e (patch) | |
tree | 2e9d9a65851ce79408c9f960b8aac1a149d6c71c /nixos/modules/services | |
parent | 78618e12d39d1088f0eb6ae647e731d3cd23ab33 (diff) | |
download | nixlib-c18775837cf7122e2448539b738beea62c96af1e.tar nixlib-c18775837cf7122e2448539b738beea62c96af1e.tar.gz nixlib-c18775837cf7122e2448539b738beea62c96af1e.tar.bz2 nixlib-c18775837cf7122e2448539b738beea62c96af1e.tar.lz nixlib-c18775837cf7122e2448539b738beea62c96af1e.tar.xz nixlib-c18775837cf7122e2448539b738beea62c96af1e.tar.zst nixlib-c18775837cf7122e2448539b738beea62c96af1e.zip |
nixos/modules/services/audio/alsa.nix: fix evaluation
https://github.com/NixOS/nixpkgs/issues/2732
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/audio/alsa.nix | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/nixos/modules/services/audio/alsa.nix b/nixos/modules/services/audio/alsa.nix index d49c2676f7df..653c0ed5d70b 100644 --- a/nixos/modules/services/audio/alsa.nix +++ b/nixos/modules/services/audio/alsa.nix @@ -7,10 +7,6 @@ let inherit (pkgs) alsaUtils; - soundState = "/var/lib/alsa/asound.state"; - - configPath = "asound.conf"; - in { @@ -39,7 +35,7 @@ in extraConfig = mkOption { type = types.lines; - default = ''''; + default = ""; example = '' defaults.pcm.!card 3 ''; @@ -59,10 +55,12 @@ in environment.systemPackages = [ alsaUtils ]; - environment.etc = [ { source = config.sound.extraConfig; - target = configPath; - } - ]; + environment.etc = mkIf (config.sound.extraConfig != "") + [ + { source = pkgs.writeText "asound.conf" config.sound.extraConfig; + target = "asound.conf"; + } + ]; # ALSA provides a udev rule for restoring volume settings. services.udev.packages = [ alsaUtils ]; |