nixos: disable sound by default, if stateVersion >= 18.03 (#35355)

authored by Aristid Breitkreuz and committed by Franz Pletz a43e33d0 664cb083

+14 -3
+3
nixos/doc/manual/release-notes/rl-1803.xml
··· 210 210 </para> 211 211 <itemizedlist> 212 212 <listitem> 213 + <literal>sound.enable</literal> now defaults to false. 214 + </listitem> 215 + <listitem> 213 216 <para> 214 217 <literal>matrix-synapse</literal> uses postgresql by default instead of sqlite. 215 218 Migration instructions can be found <link xlink:href="https://github.com/matrix-org/synapse/blob/master/docs/postgres.rst#porting-from-sqlite"> here </link>.
+4
nixos/modules/installer/tools/nixos-generate-config.pl
··· 603 603 # Enable CUPS to print documents. 604 604 # services.printing.enable = true; 605 605 606 + # Enable sound. 607 + # sound.enable = true; 608 + # hardware.pulseaudio.enable = true; 609 + 606 610 # Enable the X11 windowing system. 607 611 # services.xserver.enable = true; 608 612 # services.xserver.layout = "us";
+7 -3
nixos/modules/services/audio/alsa.nix
··· 21 21 22 22 enable = mkOption { 23 23 type = types.bool; 24 - default = true; 24 + defaultText = "!versionAtLeast system.stateVersion \"18.03\""; 25 25 description = '' 26 26 Whether to enable ALSA sound. 27 27 ''; ··· 78 78 79 79 ###### implementation 80 80 81 - config = mkIf config.sound.enable { 81 + config = mkMerge [ 82 + ({ 83 + sound.enable = mkDefault (!versionAtLeast config.system.stateVersion "18.03"); 84 + }) 85 + (mkIf config.sound.enable { 82 86 83 87 environment.systemPackages = [ alsaUtils ]; 84 88 ··· 124 128 ]; 125 129 }; 126 130 127 - }; 131 + })]; 128 132 129 133 }