Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config.allowAliases: Define as option #166792

Merged
merged 1 commit into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkgs/applications/editors/kakoune/plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/vim/plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/vscode/extensions/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/writers/default.nix
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/desktops/gnome-2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/desktops/gnome/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/desktops/gnome/extensions/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/desktops/pantheon/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pkgs/desktops/plasma-5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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'";
};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/desktops/xfce/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/idris-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/interpreters/python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ pkgs ? import <nixpkgs> {}
, nodejs ? pkgs.nodejs
, yarn ? pkgs.yarn
, allowAliases ? pkgs.config.allowAliases or true
, allowAliases ? pkgs.config.allowAliases
}:

let
Expand Down
18 changes: 18 additions & 0 deletions pkgs/top-level/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/kodi-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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." { };
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/linux-kernels.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/perl-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/stage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down