Skip to content

Commit

Permalink
nixos: disable sound by default, if stateVersion >= 18.03 (#35355)
Browse files Browse the repository at this point in the history
  • Loading branch information
aristidb authored and fpletz committed Feb 22, 2018
1 parent 664cb08 commit a43e33d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions nixos/doc/manual/release-notes/rl-1803.xml
Expand Up @@ -209,6 +209,9 @@ following incompatible changes:</para>
For <literal>stateVersion = "17.09"</literal> or lower the old behavior is preserved.
</para>
<itemizedlist>
<listitem>
<literal>sound.enable</literal> now defaults to false.

This comment has been minimized.

Copy link
@dtzWill

dtzWill Feb 22, 2018

Member

This seems to have broken the manual, which is needed to build NixOS configurations. Can you take a look? Maybe needs some <para> wrapping contents of <listitem>?

This comment has been minimized.

Copy link
@fpletz

fpletz Feb 22, 2018

Member

Thanks for catching this. I'll take a look.

This comment has been minimized.

Copy link
@fpletz

fpletz Feb 22, 2018

Member

Fixed in a04f624.

</listitem>
<listitem>
<para>
<literal>matrix-synapse</literal> uses postgresql by default instead of sqlite.
Expand Down
4 changes: 4 additions & 0 deletions nixos/modules/installer/tools/nixos-generate-config.pl
Expand Up @@ -603,6 +603,10 @@ sub multiLineList {
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# sound.enable = true;
# hardware.pulseaudio.enable = true;
# Enable the X11 windowing system.
# services.xserver.enable = true;
# services.xserver.layout = "us";
Expand Down
10 changes: 7 additions & 3 deletions nixos/modules/services/audio/alsa.nix
Expand Up @@ -21,7 +21,7 @@ in

enable = mkOption {
type = types.bool;
default = true;
defaultText = "!versionAtLeast system.stateVersion \"18.03\"";
description = ''
Whether to enable ALSA sound.
'';
Expand Down Expand Up @@ -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 ];

Expand Down Expand Up @@ -124,6 +128,6 @@ in
];
};

};
})];

}

0 comments on commit a43e33d

Please sign in to comment.