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.
This commit is contained in:
parent
a6664d8192
commit
e349ccc77f
|
@ -80,6 +80,11 @@ has the following highlights: </para>
|
||||||
following incompatible changes:</para>
|
following incompatible changes:</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<literal>sound.enable</literal> now defaults to false.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Dollar signs in options under <option>services.postfix</option> are
|
Dollar signs in options under <option>services.postfix</option> are
|
||||||
|
@ -209,11 +214,6 @@ following incompatible changes:</para>
|
||||||
For <literal>stateVersion = "17.09"</literal> or lower the old behavior is preserved.
|
For <literal>stateVersion = "17.09"</literal> or lower the old behavior is preserved.
|
||||||
</para>
|
</para>
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
<literal>sound.enable</literal> now defaults to false.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<literal>matrix-synapse</literal> uses postgresql by default instead of sqlite.
|
<literal>matrix-synapse</literal> uses postgresql by default instead of sqlite.
|
||||||
|
|
|
@ -21,7 +21,7 @@ in
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
defaultText = "!versionAtLeast system.stateVersion \"18.03\"";
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable ALSA sound.
|
Whether to enable ALSA sound.
|
||||||
'';
|
'';
|
||||||
|
@ -78,11 +78,7 @@ in
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkMerge [
|
config = mkIf config.sound.enable {
|
||||||
({
|
|
||||||
sound.enable = mkDefault (!versionAtLeast config.system.stateVersion "18.03");
|
|
||||||
})
|
|
||||||
(mkIf config.sound.enable {
|
|
||||||
|
|
||||||
environment.systemPackages = [ alsaUtils ];
|
environment.systemPackages = [ alsaUtils ];
|
||||||
|
|
||||||
|
@ -128,6 +124,6 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
})];
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue