diff options
author | Aristid Breitkreuz <aristidb@gmail.com> | 2018-02-22 23:06:31 +0100 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2018-02-22 22:06:31 +0000 |
commit | a43e33d0e48b2284ac3a2222d7f1965cef66f5e2 (patch) | |
tree | 46013e20ce274022fc2b9eb80d54257194686e4f | |
parent | 664cb083e756d3db1ea6b8433d3fa1d88046c6bd (diff) |
nixos: disable sound by default, if stateVersion >= 18.03 (#35355)
-rw-r--r-- | nixos/doc/manual/release-notes/rl-1803.xml | 3 | ||||
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 4 | ||||
-rw-r--r-- | nixos/modules/services/audio/alsa.nix | 10 |
3 files changed, 14 insertions, 3 deletions
diff --git a/nixos/doc/manual/release-notes/rl-1803.xml b/nixos/doc/manual/release-notes/rl-1803.xml index ce58c4dc95b0..469c6a9f338c 100644 --- a/nixos/doc/manual/release-notes/rl-1803.xml +++ b/nixos/doc/manual/release-notes/rl-1803.xml @@ -210,6 +210,9 @@ following incompatible changes:</para> </para> <itemizedlist> <listitem> + <literal>sound.enable</literal> now defaults to false. + </listitem> + <listitem> <para> <literal>matrix-synapse</literal> uses postgresql by default instead of sqlite. Migration instructions can be found <link xlink:href="https://github.com/matrix-org/synapse/blob/master/docs/postgres.rst#porting-from-sqlite"> here </link>. diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index a82ee63fd0cd..0e0744a52e42 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -603,6 +603,10 @@ $bootLoaderConfig # 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"; 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 ]; }; - }; + })]; } |