about summary refs log tree commit diff
path: root/pkgs/top-level
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-04-01 11:33:10 +0200
committerRobert Hensing <robert@roberthensing.nl>2022-04-01 11:33:10 +0200
commit200175a7011c0602c0a8e6d4c6583d9d577a03d1 (patch)
tree15ca935a6c86f3628507c28aa07463284cc09b4c /pkgs/top-level
parent3344cea254129714919142494ec3e9e75aa09891 (diff)
config.allowAliases: Define as option
This simplifies usages and makes the default value consistent.

In a few cases, the default value was interpreted to be `false`,
but this is useless, because virtually nobody will explicitly
set `allowAliases = true;`.
Diffstat (limited to 'pkgs/top-level')
-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
5 files changed, 22 insertions, 4 deletions
diff --git a/pkgs/top-level/config.nix b/pkgs/top-level/config.nix
index 7a5b4bdd17989..948eb5ef9b72c 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 6771ffe65b1d5..88d3aea46cbe3 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 bd7bacf300044..26e4b3229a27c 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 24cce7be3a552..322e55c8f76f7 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 1945762c50dfd..422a7500516b3 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