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-23 22:59:19 +0100
committerAristid Breitkreuz <aristidb@gmail.com>2018-02-23 23:14:42 +0100
commite349ccc77febd45abbd14be14f7de123ec4a4da2 (patch)
treeec2bd83fe67a8b9b6356e248c73366c9be0021eb /nixos/modules/services/audio/alsa.nix
parenta6664d8192038c4dc2ad44169dbb76556fe71ac1 (diff)
downloadnixlib-e349ccc77febd45abbd14be14f7de123ec4a4da2.tar
nixlib-e349ccc77febd45abbd14be14f7de123ec4a4da2.tar.gz
nixlib-e349ccc77febd45abbd14be14f7de123ec4a4da2.tar.bz2
nixlib-e349ccc77febd45abbd14be14f7de123ec4a4da2.tar.lz
nixlib-e349ccc77febd45abbd14be14f7de123ec4a4da2.tar.xz
nixlib-e349ccc77febd45abbd14be14f7de123ec4a4da2.tar.zst
nixlib-e349ccc77febd45abbd14be14f7de123ec4a4da2.zip
nixos/alsa: Do not make sound.enable conditional on stateVersion.
Eelco Dolstra wrote:

Hm, this is not really the intended use of stateVersion. From the description:

        Every once in a while, a new NixOS release may change
        configuration defaults in a way incompatible with stateful
        data. For instance, if the default version of PostgreSQL
        changes, the new version will probably be unable to read your
        existing databases. To prevent such breakage, you can set the
        value of this option to the NixOS release with which you want
        to be compatible. The effect is that NixOS will option
        defaults corresponding to the specified release (such as using
        an older version of PostgreSQL).

So this is only intended for options that have some corresponding on-disk state. AFAICT this is not the case for sound. In any case stateVersion is a necessary evil that only exists because we can't just upgrade Postgres databases or change SSH host keys. It's not necessary for things like whether sound is enabled. (If the user discovers that sound is suddenly disabled, they can just enable it.)

I had some vague recollection that we also had a configVersion option setting to control the defaults for non-state-related options, but I can't find it so maybe it was only discussed.
Diffstat (limited to 'nixos/modules/services/audio/alsa.nix')
-rw-r--r--nixos/modules/services/audio/alsa.nix10
1 files changed, 3 insertions, 7 deletions
diff --git a/nixos/modules/services/audio/alsa.nix b/nixos/modules/services/audio/alsa.nix
index 161d873686a8..e3e8bb28c58b 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;
-        defaultText = "!versionAtLeast system.stateVersion \"18.03\"";
+        default = false;
         description = ''
           Whether to enable ALSA sound.
         '';
@@ -78,11 +78,7 @@ in
 
   ###### implementation
 
-  config = mkMerge [
-    ({
-      sound.enable = mkDefault (!versionAtLeast config.system.stateVersion "18.03");
-    })
-    (mkIf config.sound.enable {
+  config = mkIf config.sound.enable {
 
     environment.systemPackages = [ alsaUtils ];
 
@@ -128,6 +124,6 @@ in
       ];
     };
 
-  })];
+  };
 
 }