summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/applications/editors/kakoune/plugins/default.nix2
-rw-r--r--pkgs/applications/editors/vim/plugins/default.nix2
-rw-r--r--pkgs/applications/editors/vscode/extensions/default.nix2
-rw-r--r--pkgs/applications/networking/cluster/terraform-providers/default.nix2
-rw-r--r--pkgs/build-support/writers/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/default.nix2
-rw-r--r--pkgs/desktops/gnome/default.nix2
-rw-r--r--pkgs/desktops/gnome/extensions/default.nix2
-rw-r--r--pkgs/desktops/pantheon/default.nix2
-rw-r--r--pkgs/desktops/plasma-5/default.nix2
-rw-r--r--pkgs/desktops/xfce/default.nix2
-rw-r--r--pkgs/development/idris-modules/default.nix2
-rw-r--r--pkgs/development/interpreters/python/default.nix2
-rw-r--r--pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix2
-rw-r--r--pkgs/top-level/config.nix18
-rw-r--r--pkgs/top-level/kodi-packages.nix2
-rw-r--r--pkgs/top-level/linux-kernels.nix2
-rw-r--r--pkgs/top-level/perl-packages.nix2
-rw-r--r--pkgs/top-level/stage.nix2
19 files changed, 36 insertions, 18 deletions
diff --git a/pkgs/applications/editors/kakoune/plugins/default.nix b/pkgs/applications/editors/kakoune/plugins/default.nix
index 1fe16a4e60c..dc4381446b9 100644
--- a/pkgs/applications/editors/kakoune/plugins/default.nix
+++ b/pkgs/applications/editors/kakoune/plugins/default.nix
@@ -18,7 +18,7 @@ let
     inherit buildKakounePluginFrom2Nix;
   };
 
-  aliases = lib.optionalAttrs (config.allowAliases or true) (import ./aliases.nix lib plugins);
+  aliases = lib.optionalAttrs config.allowAliases (import ./aliases.nix lib plugins);
 
 in
 
diff --git a/pkgs/applications/editors/vim/plugins/default.nix b/pkgs/applications/editors/vim/plugins/default.nix
index 9bfcf443186..1e847e69540 100644
--- a/pkgs/applications/editors/vim/plugins/default.nix
+++ b/pkgs/applications/editors/vim/plugins/default.nix
@@ -35,7 +35,7 @@ let
     inherit llvmPackages luaPackages;
   };
 
-  aliases = if (config.allowAliases or true) then (import ./aliases.nix lib) else final: prev: {};
+  aliases = if config.allowAliases then (import ./aliases.nix lib) else final: prev: {};
 
   extensible-self = lib.makeExtensible
     (extends aliases
diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix
index a5c8dcfb50f..ab5250a48e6 100644
--- a/pkgs/applications/editors/vscode/extensions/default.nix
+++ b/pkgs/applications/editors/vscode/extensions/default.nix
@@ -2329,7 +2329,7 @@ let
   # then apply extension specific modifcations to packages.
 
   # overlays will be applied left to right, overrides should come after aliases.
-  overlays = lib.optionals (config.allowAliases or true) [ aliases ];
+  overlays = lib.optionals config.allowAliases [ aliases ];
 
   toFix = lib.foldl' (lib.flip lib.extends) baseExtensions overlays;
 in
diff --git a/pkgs/applications/networking/cluster/terraform-providers/default.nix b/pkgs/applications/networking/cluster/terraform-providers/default.nix
index 93be46bc792..0bdb6289a61 100644
--- a/pkgs/applications/networking/cluster/terraform-providers/default.nix
+++ b/pkgs/applications/networking/cluster/terraform-providers/default.nix
@@ -68,7 +68,7 @@ let
       archived = date: throw "the provider has been archived by upstream on ${date}";
       removed = date: throw "removed from nixpkgs on ${date}";
     in
-    lib.optionalAttrs (config.allowAliases or false) {
+    lib.optionalAttrs config.allowAliases {
       arukas = archived "2022/01";
       chef = archived "2022/01";
       cherryservers = archived "2022/01";
diff --git a/pkgs/build-support/writers/default.nix b/pkgs/build-support/writers/default.nix
index 0fb9bd939a5..2eb021236f9 100644
--- a/pkgs/build-support/writers/default.nix
+++ b/pkgs/build-support/writers/default.nix
@@ -1,7 +1,7 @@
 { pkgs, config, buildPackages, lib, stdenv, libiconv, mkNugetDeps, mkNugetSource, gawk, gnused, gixy }:
 
 let
-  aliases = if (config.allowAliases or true) then (import ./aliases.nix lib) else prev: {};
+  aliases = if config.allowAliases then (import ./aliases.nix lib) else prev: {};
 
   writers = with lib; rec {
   # Base implementation for non-compiled executables.
diff --git a/pkgs/desktops/gnome-2/default.nix b/pkgs/desktops/gnome-2/default.nix
index a8ff7b58ed3..29dbbdd2f12 100644
--- a/pkgs/desktops/gnome-2/default.nix
+++ b/pkgs/desktops/gnome-2/default.nix
@@ -62,7 +62,7 @@ lib.makeScope pkgs.newScope (self: with self; {
     autoreconfHook = pkgs.autoreconfHook269;
   };
 
-} // lib.optionalAttrs (config.allowAliases or true) {
+} // lib.optionalAttrs config.allowAliases {
   inherit (pkgs)
     # GTK Libs
     glib glibmm atk atkmm cairo pango pangomm gdk_pixbuf gtkmm2 libcanberra-gtk2
diff --git a/pkgs/desktops/gnome/default.nix b/pkgs/desktops/gnome/default.nix
index 729a6bd16ca..892b085ead4 100644
--- a/pkgs/desktops/gnome/default.nix
+++ b/pkgs/desktops/gnome/default.nix
@@ -276,7 +276,7 @@ lib.makeScope pkgs.newScope (self: with self; {
   gnome-autoar = callPackage ./misc/gnome-autoar { };
 
   gnome-packagekit = callPackage ./misc/gnome-packagekit { };
-}) // lib.optionalAttrs (config.allowAliases or true) {
+}) // lib.optionalAttrs config.allowAliases {
 #### Legacy aliases. They need to be outside the scope or they will shadow the attributes from parent scope.
 
   gnome-desktop = pkgs.gnome-desktop; # added 2022-03-16
diff --git a/pkgs/desktops/gnome/extensions/default.nix b/pkgs/desktops/gnome/extensions/default.nix
index d01c28be92c..2fb5216467b 100644
--- a/pkgs/desktops/gnome/extensions/default.nix
+++ b/pkgs/desktops/gnome/extensions/default.nix
@@ -69,7 +69,7 @@ in rec {
     (lib.attrValues)
     (mapReadableNames)
     # Add some aliases
-    (extensions: extensions // lib.optionalAttrs (config.allowAliases or true) {
+    (extensions: extensions // lib.optionalAttrs config.allowAliases {
       unite-shell = gnomeExtensions.unite; # added 2021-01-19
       arc-menu = gnomeExtensions.arcmenu; # added 2021-02-14
       disable-unredirect = gnomeExtensions.disable-unredirect-fullscreen-windows; # added 2021-11-20
diff --git a/pkgs/desktops/pantheon/default.nix b/pkgs/desktops/pantheon/default.nix
index a3d5f873cbc..4e3eeea58e8 100644
--- a/pkgs/desktops/pantheon/default.nix
+++ b/pkgs/desktops/pantheon/default.nix
@@ -226,7 +226,7 @@ lib.makeScope pkgs.newScope (self: with self; {
   # Please call these packages in pkgs/top-level/all-packages.nix instead of this file.
   # https://github.com/NixOS/nixpkgs/issues/115222#issuecomment-906868654
 
-}) // lib.optionalAttrs (config.allowAliases or true) {
+}) // lib.optionalAttrs config.allowAliases {
 
   ### ALIASES
 
diff --git a/pkgs/desktops/plasma-5/default.nix b/pkgs/desktops/plasma-5/default.nix
index 54534f63f7d..87f89330afe 100644
--- a/pkgs/desktops/plasma-5/default.nix
+++ b/pkgs/desktops/plasma-5/default.nix
@@ -166,7 +166,7 @@ let
         parachute = callPackage ./3rdparty/kwin/scripts/parachute.nix { };
       };
 
-    } // lib.optionalAttrs (config.allowAliases or true) {
+    } // lib.optionalAttrs config.allowAliases {
       ksysguard = throw "ksysguard has been replaced with plasma-systemmonitor";
       plasma-phone-components = throw "'plasma-phone-components' has been renamed to/replaced by 'plasma-mobile'";
     };
diff --git a/pkgs/desktops/xfce/default.nix b/pkgs/desktops/xfce/default.nix
index 0205a722639..d2f3922fda7 100644
--- a/pkgs/desktops/xfce/default.nix
+++ b/pkgs/desktops/xfce/default.nix
@@ -156,7 +156,7 @@ lib.makeScope pkgs.newScope (self: with self; {
 
   xfce4-pulseaudio-plugin = callPackage ./panel-plugins/xfce4-pulseaudio-plugin { };
 
-} // lib.optionalAttrs (config.allowAliases or true) {
+} // lib.optionalAttrs config.allowAliases {
   #### ALIASES - added 2018-01
 
   terminal = xfce4-terminal;
diff --git a/pkgs/development/idris-modules/default.nix b/pkgs/development/idris-modules/default.nix
index ea8697482da..59069d87899 100644
--- a/pkgs/development/idris-modules/default.nix
+++ b/pkgs/development/idris-modules/default.nix
@@ -205,7 +205,7 @@
 
     yampa = callPackage ./yampa.nix {};
 
-  } // builtins_ // pkgs.lib.optionalAttrs (config.allowAliases or true) {
+  } // builtins_ // pkgs.lib.optionalAttrs config.allowAliases {
     # removed packages
     protobuf = throw "idrisPackages.protobuf has been removed: abandoned by upstream"; # Added 2022-02-06
   };
diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix
index 579e3a05c58..bac5ba69c44 100644
--- a/pkgs/development/interpreters/python/default.nix
+++ b/pkgs/development/interpreters/python/default.nix
@@ -75,7 +75,7 @@ with pkgs;
           optionalExtensions = cond: as: if cond then as else [];
           python2Extension = import ../../../top-level/python2-packages.nix;
           extensions = lib.composeManyExtensions ((optionalExtensions (!self.isPy3k) [python2Extension]) ++ [ overrides ]);
-          aliases = self: super: lib.optionalAttrs (config.allowAliases or true) (import ../../../top-level/python-aliases.nix lib self super);
+          aliases = self: super: lib.optionalAttrs config.allowAliases (import ../../../top-level/python-aliases.nix lib self super);
         in lib.makeScopeWithSplicing
           pkgs.splicePackages
           pkgs.newScope
diff --git a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix
index 3b30e2a8af0..67c9b91594b 100644
--- a/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix
+++ b/pkgs/development/tools/yarn2nix-moretea/yarn2nix/default.nix
@@ -1,7 +1,7 @@
 { pkgs ? import <nixpkgs> {}
 , nodejs ? pkgs.nodejs
 , yarn ? pkgs.yarn
-, allowAliases ? pkgs.config.allowAliases or true
+, allowAliases ? pkgs.config.allowAliases
 }:
 
 let
diff --git a/pkgs/top-level/config.nix b/pkgs/top-level/config.nix
index 7a5b4bdd179..948eb5ef9b7 100644
--- a/pkgs/top-level/config.nix
+++ b/pkgs/top-level/config.nix
@@ -32,6 +32,24 @@ let
       feature = "run <literal>checkPhase</literal> by default";
     };
 
+    allowAliases = mkOption {
+      type = types.bool;
+      default = true;
+      description = ''
+        Whether to expose old attribute names for compatibility.
+
+        The recommended setting is to enable this, as it
+        improves backward compatibity, easing updates.
+
+        The only reason to disable aliases is for continuous
+        integration purposes. For instance, Nixpkgs should
+        not depend on aliases in its internal code. Projects
+        that aren't Nixpkgs should be cautious of instantly
+        removing all usages of aliases, as migrating too soon
+        can break compatibility with the stable Nixpkgs releases.
+      '';
+    };
+
   };
 
 in {
diff --git a/pkgs/top-level/kodi-packages.nix b/pkgs/top-level/kodi-packages.nix
index 6771ffe65b1..88d3aea46cb 100644
--- a/pkgs/top-level/kodi-packages.nix
+++ b/pkgs/top-level/kodi-packages.nix
@@ -153,7 +153,7 @@ let self = rec {
   trakt-module = callPackage ../applications/video/kodi/addons/trakt-module { };
 
   trakt = callPackage ../applications/video/kodi/addons/trakt { };
-}; in self // lib.optionalAttrs (config.allowAliases or true) {
+}; in self // lib.optionalAttrs config.allowAliases {
   # deprecated or renamed packages
 
   controllers = throw "kodi.packages.controllers has been replaced with kodi.packages.controller-topology-project - a package which contains a large number of controller profiles." { };
diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix
index bd7bacf3000..26e4b3229a2 100644
--- a/pkgs/top-level/linux-kernels.nix
+++ b/pkgs/top-level/linux-kernels.nix
@@ -476,7 +476,7 @@ in {
 
     can-isotp = callPackage ../os-specific/linux/can-isotp { };
 
-  } // lib.optionalAttrs (config.allowAliases or false) {
+  } // lib.optionalAttrs config.allowAliases {
     ati_drivers_x11 = throw "ati drivers are no longer supported by any kernel >=4.1"; # added 2021-05-18;
   });
 
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 24cce7be3a5..322e55c8f76 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -25392,7 +25392,7 @@ let
     };
   };
 
-} // lib.optionalAttrs (config.allowAliases or true) {
+} // lib.optionalAttrs config.allowAliases {
   autodie = null; # part of Perl
   AutoLoader = null; # part of Perl 5.22
   constant = null; # part of Perl 5.22
diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix
index 1945762c50d..422a7500516 100644
--- a/pkgs/top-level/stage.nix
+++ b/pkgs/top-level/stage.nix
@@ -152,7 +152,7 @@ let
       res self super;
     in res;
 
-  aliases = self: super: lib.optionalAttrs (config.allowAliases or true) (import ./aliases.nix lib self super);
+  aliases = self: super: lib.optionalAttrs config.allowAliases (import ./aliases.nix lib self super);
 
   # stdenvOverrides is used to avoid having multiple of versions
   # of certain dependencies that were used in bootstrapping the