summary refs log tree commit diff
path: root/nixos/modules/services/audio/alsa.nix
diff options
context:
space:
mode:
authorAristid Breitkreuz <aristidb@gmail.com>2018-02-22 23:06:31 +0100
committerFranz Pletz <fpletz@fnordicwalking.de>2018-02-22 22:06:31 +0000
commita43e33d0e48b2284ac3a2222d7f1965cef66f5e2 (patch)
tree46013e20ce274022fc2b9eb80d54257194686e4f /nixos/modules/services/audio/alsa.nix
parent664cb083e756d3db1ea6b8433d3fa1d88046c6bd (diff)
downloadnixlib-a43e33d0e48b2284ac3a2222d7f1965cef66f5e2.tar
nixlib-a43e33d0e48b2284ac3a2222d7f1965cef66f5e2.tar.gz
nixlib-a43e33d0e48b2284ac3a2222d7f1965cef66f5e2.tar.bz2
nixlib-a43e33d0e48b2284ac3a2222d7f1965cef66f5e2.tar.lz
nixlib-a43e33d0e48b2284ac3a2222d7f1965cef66f5e2.tar.xz
nixlib-a43e33d0e48b2284ac3a2222d7f1965cef66f5e2.tar.zst
nixlib-a43e33d0e48b2284ac3a2222d7f1965cef66f5e2.zip
nixos: disable sound by default, if stateVersion >= 18.03 (#35355)
Diffstat (limited to 'nixos/modules/services/audio/alsa.nix')
-rw-r--r--nixos/modules/services/audio/alsa.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/nixos/modules/services/audio/alsa.nix b/nixos/modules/services/audio/alsa.nix
index acf48d3c3d03..161d873686a8 100644
--- a/nixos/modules/services/audio/alsa.nix
+++ b/nixos/modules/services/audio/alsa.nix
@@ -21,7 +21,7 @@ in
 
       enable = mkOption {
         type = types.bool;
-        default = true;
+        defaultText = "!versionAtLeast system.stateVersion \"18.03\"";
         description = ''
           Whether to enable ALSA sound.
         '';
@@ -78,7 +78,11 @@ in
 
   ###### implementation
 
-  config = mkIf config.sound.enable {
+  config = mkMerge [
+    ({
+      sound.enable = mkDefault (!versionAtLeast config.system.stateVersion "18.03");
+    })
+    (mkIf config.sound.enable {
 
     environment.systemPackages = [ alsaUtils ];
 
@@ -124,6 +128,6 @@ in
       ];
     };
 
-  };
+  })];
 
 }