Merge pull request #123229 from superherointj/nixpkgs-toplevel-allpackages-editorformat

top-level: refactor of all-packages to comply w/ editorconfig-checker
This commit is contained in:
Graham Christensen 2021-05-16 07:52:10 -04:00 committed by GitHub
commit 9b92a81723
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -457,60 +457,60 @@ in
# `fetchurl' downloads a file from the network. # `fetchurl' downloads a file from the network.
fetchurl = if stdenv.buildPlatform != stdenv.hostPlatform fetchurl = if stdenv.buildPlatform != stdenv.hostPlatform
then buildPackages.fetchurl # No need to do special overrides twice, then buildPackages.fetchurl # No need to do special overrides twice,
else makeOverridable (import ../build-support/fetchurl) { else makeOverridable (import ../build-support/fetchurl) {
inherit lib stdenvNoCC buildPackages; inherit lib stdenvNoCC buildPackages;
inherit cacert; inherit cacert;
curl = buildPackages.curlMinimal.override (old: rec { curl = buildPackages.curlMinimal.override (old: rec {
# break dependency cycles # break dependency cycles
fetchurl = stdenv.fetchurlBoot;
zlib = buildPackages.zlib.override { fetchurl = stdenv.fetchurlBoot; };
pkg-config = buildPackages.pkg-config.override (old: {
pkg-config = old.pkg-config.override {
fetchurl = stdenv.fetchurlBoot;
};
});
perl = buildPackages.perl.override { fetchurl = stdenv.fetchurlBoot; };
openssl = buildPackages.openssl.override {
fetchurl = stdenv.fetchurlBoot; fetchurl = stdenv.fetchurlBoot;
buildPackages = { zlib = buildPackages.zlib.override { fetchurl = stdenv.fetchurlBoot; };
coreutils = buildPackages.coreutils.override { pkg-config = buildPackages.pkg-config.override (old: {
pkg-config = old.pkg-config.override {
fetchurl = stdenv.fetchurlBoot; fetchurl = stdenv.fetchurlBoot;
};
});
perl = buildPackages.perl.override { fetchurl = stdenv.fetchurlBoot; };
openssl = buildPackages.openssl.override {
fetchurl = stdenv.fetchurlBoot;
buildPackages = {
coreutils = buildPackages.coreutils.override {
fetchurl = stdenv.fetchurlBoot;
inherit perl;
xz = buildPackages.xz.override { fetchurl = stdenv.fetchurlBoot; };
gmp = null;
aclSupport = false;
attrSupport = false;
};
inherit perl; inherit perl;
xz = buildPackages.xz.override { fetchurl = stdenv.fetchurlBoot; };
gmp = null;
aclSupport = false;
attrSupport = false;
}; };
inherit perl; inherit perl;
}; };
inherit perl; libssh2 = buildPackages.libssh2.override {
}; fetchurl = stdenv.fetchurlBoot;
libssh2 = buildPackages.libssh2.override { inherit zlib openssl;
fetchurl = stdenv.fetchurlBoot; };
inherit zlib openssl; # On darwin, libkrb5 needs bootstrap_cmds which would require
}; # converting many packages to fetchurl_boot to avoid evaluation cycles.
# On darwin, libkrb5 needs bootstrap_cmds which would require # So turn gssSupport off there, and on Windows.
# converting many packages to fetchurl_boot to avoid evaluation cycles. # On other platforms, keep the previous value.
# So turn gssSupport off there, and on Windows. gssSupport =
# On other platforms, keep the previous value. if stdenv.isDarwin || stdenv.hostPlatform.isWindows
gssSupport = then false
if stdenv.isDarwin || stdenv.hostPlatform.isWindows else old.gssSupport or true; # `? true` is the default
then false libkrb5 = buildPackages.libkrb5.override {
else old.gssSupport or true; # `? true` is the default fetchurl = stdenv.fetchurlBoot;
libkrb5 = buildPackages.libkrb5.override { inherit pkg-config perl openssl;
fetchurl = stdenv.fetchurlBoot; keyutils = buildPackages.keyutils.override { fetchurl = stdenv.fetchurlBoot; };
inherit pkg-config perl openssl; };
keyutils = buildPackages.keyutils.override { fetchurl = stdenv.fetchurlBoot; }; nghttp2 = buildPackages.nghttp2.override {
}; fetchurl = stdenv.fetchurlBoot;
nghttp2 = buildPackages.nghttp2.override { inherit zlib pkg-config openssl;
fetchurl = stdenv.fetchurlBoot; c-ares = buildPackages.c-ares.override { fetchurl = stdenv.fetchurlBoot; };
inherit zlib pkg-config openssl; libev = buildPackages.libev.override { fetchurl = stdenv.fetchurlBoot; };
c-ares = buildPackages.c-ares.override { fetchurl = stdenv.fetchurlBoot; }; };
libev = buildPackages.libev.override { fetchurl = stdenv.fetchurlBoot; }; });
}; };
});
};
fetchRepoProject = callPackage ../build-support/fetchrepoproject { }; fetchRepoProject = callPackage ../build-support/fetchrepoproject { };
@ -1470,7 +1470,7 @@ in
grc = python3Packages.callPackage ../tools/misc/grc { }; grc = python3Packages.callPackage ../tools/misc/grc { };
green-pdfviewer = callPackage ../applications/misc/green-pdfviewer { green-pdfviewer = callPackage ../applications/misc/green-pdfviewer {
SDL = SDL_sixel; SDL = SDL_sixel;
}; };
gremlin-console = callPackage ../applications/misc/gremlin-console { gremlin-console = callPackage ../applications/misc/gremlin-console {
@ -4233,7 +4233,7 @@ in
wallutils = callPackage ../tools/graphics/wallutils { }; wallutils = callPackage ../tools/graphics/wallutils { };
wrangler = callPackage ../development/tools/wrangler { wrangler = callPackage ../development/tools/wrangler {
inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Security; inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Security;
}; };
wsl-open = callPackage ../tools/misc/wsl-open { }; wsl-open = callPackage ../tools/misc/wsl-open { };
@ -5145,10 +5145,9 @@ in
gnu-pw-mgr = callPackage ../tools/security/gnu-pw-mgr { }; gnu-pw-mgr = callPackage ../tools/security/gnu-pw-mgr { };
gnused = if !stdenv.hostPlatform.isWindows then gnused = if !stdenv.hostPlatform.isWindows
callPackage ../tools/text/gnused { } # broken on Windows then callPackage ../tools/text/gnused { } # broken on Windows
else else gnused_422;
gnused_422;
# This is an easy work-around for [:space:] problems. # This is an easy work-around for [:space:] problems.
gnused_422 = callPackage ../tools/text/gnused/422.nix { }; gnused_422 = callPackage ../tools/text/gnused/422.nix { };
@ -10451,8 +10450,8 @@ in
crossLibcStdenv = overrideCC stdenv crossLibcStdenv = overrideCC stdenv
(if stdenv.hostPlatform.useLLVM or false (if stdenv.hostPlatform.useLLVM or false
then buildPackages.llvmPackages_8.lldClangNoLibc then buildPackages.llvmPackages_8.lldClangNoLibc
else buildPackages.gccCrossStageStatic); else buildPackages.gccCrossStageStatic);
# The GCC used to build libc for the target platform. Normal gccs will be # The GCC used to build libc for the target platform. Normal gccs will be
# built with, and use, that cross-compiled libc. # built with, and use, that cross-compiled libc.
@ -11274,15 +11273,15 @@ in
mint = callPackage ../development/compilers/mint { }; mint = callPackage ../development/compilers/mint { };
mitscheme = callPackage ../development/compilers/mit-scheme { mitscheme = callPackage ../development/compilers/mit-scheme {
texLive = texlive.combine { inherit (texlive) scheme-small; }; texLive = texlive.combine { inherit (texlive) scheme-small; };
texinfo = texinfo5; texinfo = texinfo5;
xlibsWrapper = null; xlibsWrapper = null;
}; };
mitschemeX11 = mitscheme.override { mitschemeX11 = mitscheme.override {
texLive = texlive.combine { inherit (texlive) scheme-small; }; texLive = texlive.combine { inherit (texlive) scheme-small; };
texinfo = texinfo5; texinfo = texinfo5;
enableX11 = true; enableX11 = true;
}; };
miranda = callPackage ../development/compilers/miranda {}; miranda = callPackage ../development/compilers/miranda {};
@ -12916,7 +12915,7 @@ in
# }; # };
# #
distccWrapper = makeOverridable ({ extraConfig ? "" }: distccWrapper = makeOverridable ({ extraConfig ? "" }:
wrapCC (distcc.links extraConfig)) {}; wrapCC (distcc.links extraConfig)) {};
distccStdenv = lowPrio (overrideCC stdenv buildPackages.distccWrapper); distccStdenv = lowPrio (overrideCC stdenv buildPackages.distccWrapper);
distccMasquerade = if stdenv.isDarwin distccMasquerade = if stdenv.isDarwin
@ -16062,8 +16061,8 @@ in
libiconv = libiconv =
if lib.elem stdenv.hostPlatform.libc ["glibc" "musl" "wasilibc"] if lib.elem stdenv.hostPlatform.libc ["glibc" "musl" "wasilibc"]
then glibcIconv (if stdenv.hostPlatform != stdenv.buildPlatform then glibcIconv (if stdenv.hostPlatform != stdenv.buildPlatform
then libcCross then libcCross
else stdenv.cc.libc) else stdenv.cc.libc)
else if stdenv.hostPlatform.isDarwin else if stdenv.hostPlatform.isDarwin
then darwin.libiconv then darwin.libiconv
else libiconvReal; else libiconvReal;
@ -17520,13 +17519,13 @@ in
s2geometry = callPackage ../development/libraries/s2geometry { }; s2geometry = callPackage ../development/libraries/s2geometry { };
/* This package references ghc844, which we no longer have. Unfortunately, I /* This package references ghc844, which we no longer have. Unfortunately, I
have been unable to mark it as "broken" in a way that the ofBorg bot have been unable to mark it as "broken" in a way that the ofBorg bot
recognizes. Since I don't want to merge code into master that generates recognizes. Since I don't want to merge code into master that generates
evaluation errors, I have no other idea but to comment it out entirely. evaluation errors, I have no other idea but to comment it out entirely.
sad = callPackage ../applications/science/logic/sad { }; sad = callPackage ../applications/science/logic/sad { };
*/ */
safefile = callPackage ../development/libraries/safefile {}; safefile = callPackage ../development/libraries/safefile {};
@ -20253,11 +20252,11 @@ in
]; ];
}; };
/* Linux kernel modules are inherently tied to a specific kernel. So /* Linux kernel modules are inherently tied to a specific kernel. So
rather than provide specific instances of those packages for a rather than provide specific instances of those packages for a
specific kernel, we have a function that builds those packages specific kernel, we have a function that builds those packages
for a specific kernel. This function can then be called for for a specific kernel. This function can then be called for
whatever kernel you're using. */ whatever kernel you're using. */
linuxPackagesFor = kernel_: lib.makeExtensible (self: with self; { linuxPackagesFor = kernel_: lib.makeExtensible (self: with self; {
callPackage = newScope self; callPackage = newScope self;
@ -20397,9 +20396,8 @@ in
mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { }; mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { };
/* compiles but has to be integrated into the kernel somehow # compiles but has to be integrated into the kernel somehow
Let's have it uncommented and finish it.. # Let's have it uncommented and finish it..
*/
ndiswrapper = callPackage ../os-specific/linux/ndiswrapper { }; ndiswrapper = callPackage ../os-specific/linux/ndiswrapper { };
netatop = callPackage ../os-specific/linux/netatop { }; netatop = callPackage ../os-specific/linux/netatop { };
@ -20458,13 +20456,12 @@ in
zenpower = callPackage ../os-specific/linux/zenpower { }; zenpower = callPackage ../os-specific/linux/zenpower { };
inherit (callPackages ../os-specific/linux/zfs { inherit (callPackages ../os-specific/linux/zfs {
configFile = "kernel"; configFile = "kernel";
inherit kernel; inherit kernel;
}) zfsStable zfsUnstable; }) zfsStable zfsUnstable;
zfs = zfsStable;
zfs = zfsStable; can-isotp = callPackage ../os-specific/linux/can-isotp { };
can-isotp = callPackage ../os-specific/linux/can-isotp { };
}); });
# The current default kernel / kernel modules. # The current default kernel / kernel modules.
@ -20709,8 +20706,9 @@ in
inherit (darwin.apple_sdk.frameworks) AppKit Security; inherit (darwin.apple_sdk.frameworks) AppKit Security;
}; };
nettools = if stdenv.isLinux then callPackage ../os-specific/linux/net-tools { } nettools = if stdenv.isLinux
else unixtools.nettools; then callPackage ../os-specific/linux/net-tools { }
else unixtools.nettools;
nettools_mptcp = callPackage ../os-specific/linux/net-tools/mptcp.nix { }; nettools_mptcp = callPackage ../os-specific/linux/net-tools/mptcp.nix { };
@ -20909,8 +20907,9 @@ in
prayer = callPackage ../servers/prayer { }; prayer = callPackage ../servers/prayer { };
procps = if stdenv.isLinux then callPackage ../os-specific/linux/procps-ng { } procps = if stdenv.isLinux
else unixtools.procps; then callPackage ../os-specific/linux/procps-ng { }
else unixtools.procps;
procdump = callPackage ../os-specific/linux/procdump { }; procdump = callPackage ../os-specific/linux/procdump { };
@ -22060,7 +22059,6 @@ in
ucs-fonts = callPackage ../data/fonts/ucs-fonts ucs-fonts = callPackage ../data/fonts/ucs-fonts
{ inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; { inherit (buildPackages.xorg) fonttosfnt mkfontscale; };
ultimate-oldschool-pc-font-pack = callPackage ../data/fonts/ultimate-oldschool-pc-font-pack { }; ultimate-oldschool-pc-font-pack = callPackage ../data/fonts/ultimate-oldschool-pc-font-pack { };
ultralist = callPackage ../applications/misc/ultralist { }; ultralist = callPackage ../applications/misc/ultralist { };
@ -22068,7 +22066,7 @@ in
undefined-medium = callPackage ../data/fonts/undefined-medium { }; undefined-medium = callPackage ../data/fonts/undefined-medium { };
uni-vga = callPackage ../data/fonts/uni-vga uni-vga = callPackage ../data/fonts/uni-vga
{ inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; { inherit (buildPackages.xorg) fonttosfnt mkfontscale; };
unicode-character-database = callPackage ../data/misc/unicode-character-database { }; unicode-character-database = callPackage ../data/misc/unicode-character-database { };
@ -22077,7 +22075,7 @@ in
unihan-database = callPackage ../data/misc/unihan-database { }; unihan-database = callPackage ../data/misc/unihan-database { };
unifont = callPackage ../data/fonts/unifont unifont = callPackage ../data/fonts/unifont
{ inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; { inherit (buildPackages.xorg) fonttosfnt mkfontscale; };
unifont_upper = callPackage ../data/fonts/unifont_upper { }; unifont_upper = callPackage ../data/fonts/unifont_upper { };
@ -23108,7 +23106,7 @@ in
flwrap = callPackage ../applications/radio/flwrap { }; flwrap = callPackage ../applications/radio/flwrap { };
fluidsynth = callPackage ../applications/audio/fluidsynth { fluidsynth = callPackage ../applications/audio/fluidsynth {
inherit (darwin.apple_sdk.frameworks) AudioUnit CoreAudio CoreMIDI CoreServices; inherit (darwin.apple_sdk.frameworks) AudioUnit CoreAudio CoreMIDI CoreServices;
}; };
fluidsynth_1 = fluidsynth.override { version = "1"; }; fluidsynth_1 = fluidsynth.override { version = "1"; };
@ -25105,9 +25103,8 @@ in
plank = callPackage ../applications/misc/plank { }; plank = callPackage ../applications/misc/plank { };
playonlinux = callPackage ../applications/misc/playonlinux { playonlinux = callPackage ../applications/misc/playonlinux
stdenv = stdenv_32bit; { stdenv = stdenv_32bit; };
};
pleroma-bot = python3Packages.callPackage ../development/python-modules/pleroma-bot { }; pleroma-bot = python3Packages.callPackage ../development/python-modules/pleroma-bot { };
@ -27510,10 +27507,10 @@ in
zgrviewer = callPackage ../applications/graphics/zgrviewer { }; zgrviewer = callPackage ../applications/graphics/zgrviewer { };
zgv = callPackage ../applications/graphics/zgv { zgv = callPackage ../applications/graphics/zgv {
# Enable the below line for terminal display. Note # Enable the below line for terminal display. Note
# that it requires sixel graphics compatible terminals like mlterm # that it requires sixel graphics compatible terminals like mlterm
# or xterm -ti 340 # or xterm -ti 340
SDL = SDL_sixel; SDL = SDL_sixel;
}; };
zim = callPackage ../applications/office/zim { }; zim = callPackage ../applications/office/zim { };
@ -29444,8 +29441,8 @@ in
elan = callPackage ../applications/science/logic/elan {}; elan = callPackage ../applications/science/logic/elan {};
mathlibtools = with python3Packages; toPythonApplication mathlibtools; mathlibtools = with python3Packages; toPythonApplication mathlibtools;
leo2 = callPackage ../applications/science/logic/leo2 { leo2 = callPackage ../applications/science/logic/leo2
ocaml = ocaml-ng.ocamlPackages_4_01_0.ocaml;}; { ocaml = ocaml-ng.ocamlPackages_4_01_0.ocaml; };
leo3-bin = callPackage ../applications/science/logic/leo3/binary.nix {}; leo3-bin = callPackage ../applications/science/logic/leo3/binary.nix {};
@ -30241,57 +30238,58 @@ in
nixops-dns = callPackage ../tools/package-management/nixops/nixops-dns.nix { }; nixops-dns = callPackage ../tools/package-management/nixops/nixops-dns.nix { };
/* Evaluate a NixOS configuration using this evaluation of Nixpkgs. /*
Evaluate a NixOS configuration using this evaluation of Nixpkgs.
With this function you can write, for example, a package that With this function you can write, for example, a package that
depends on a custom virtual machine image. depends on a custom virtual machine image.
Parameter: A module, path or list of those that represent the Parameter: A module, path or list of those that represent the
configuration of the NixOS system to be constructed. configuration of the NixOS system to be constructed.
Result: An attribute set containing packages produced by this Result: An attribute set containing packages produced by this
evaluation of NixOS, such as toplevel, kernel and evaluation of NixOS, such as toplevel, kernel and
initialRamdisk. initialRamdisk.
The result can be extended in the modules by defining The result can be extended in the modules by defining
extra attributes in system.build. extra attributes in system.build.
Alternatively, you may use the result's config and Alternatively, you may use the result's config and
options attributes to query any option. options attributes to query any option.
Example: Example:
let let
myOS = pkgs.nixos ({ lib, pkgs, config, ... }: { myOS = pkgs.nixos ({ lib, pkgs, config, ... }: {
config.services.nginx = { config.services.nginx = {
enable = true; enable = true;
# ... # ...
}; };
# Use config.system.build to exports relevant parts of a # Use config.system.build to exports relevant parts of a
# configuration. The runner attribute should not be # configuration. The runner attribute should not be
# considered a fully general replacement for systemd # considered a fully general replacement for systemd
# functionality. # functionality.
config.system.build.run-nginx = config.systemd.services.nginx.runner; config.system.build.run-nginx = config.systemd.services.nginx.runner;
}); });
in in
myOS.run-nginx myOS.run-nginx
Unlike in plain NixOS, the nixpkgs.config and Unlike in plain NixOS, the nixpkgs.config and
nixpkgs.system options will be ignored by default. Instead, nixpkgs.system options will be ignored by default. Instead,
nixpkgs.pkgs will have the default value of pkgs as it was nixpkgs.pkgs will have the default value of pkgs as it was
constructed right after invoking the nixpkgs function (e.g. the constructed right after invoking the nixpkgs function (e.g. the
value of import <nixpkgs> { overlays = [./my-overlay.nix]; } value of import <nixpkgs> { overlays = [./my-overlay.nix]; }
but not the value of (import <nixpkgs> {} // { extra = ...; }). but not the value of (import <nixpkgs> {} // { extra = ...; }).
If you do want to use the config.nixpkgs options, you are If you do want to use the config.nixpkgs options, you are
probably better off by calling nixos/lib/eval-config.nix probably better off by calling nixos/lib/eval-config.nix
directly, even though it is possible to set config.nixpkgs.pkgs. directly, even though it is possible to set config.nixpkgs.pkgs.
For more information about writing NixOS modules, see For more information about writing NixOS modules, see
https://nixos.org/nixos/manual/index.html#sec-writing-modules https://nixos.org/nixos/manual/index.html#sec-writing-modules
Note that you will need to have called Nixpkgs with the system Note that you will need to have called Nixpkgs with the system
parameter set to the right value for your deployment target. parameter set to the right value for your deployment target.
*/ */
nixos = nixos =
configuration: configuration:
@ -30359,11 +30357,11 @@ in
test: test:
let let
loadedTest = if builtins.typeOf test == "path" loadedTest = if builtins.typeOf test == "path"
then import test then import test
else test; else test;
calledTest = if pkgs.lib.isFunction loadedTest calledTest = if pkgs.lib.isFunction loadedTest
then callPackage loadedTest {} then callPackage loadedTest {}
else loadedTest; else loadedTest;
in in
nixosTesting.makeTest calledTest; nixosTesting.makeTest calledTest;
@ -31023,10 +31021,10 @@ in
}; };
xsw = callPackage ../applications/misc/xsw { xsw = callPackage ../applications/misc/xsw {
# Enable the next line to use this in terminal. # Enable the next line to use this in terminal.
# Note that it requires sixel capable terminals such as mlterm # Note that it requires sixel capable terminals such as mlterm
# or xterm -ti 340 # or xterm -ti 340
SDL = SDL_sixel; SDL = SDL_sixel;
}; };
xteddy = callPackage ../applications/misc/xteddy { }; xteddy = callPackage ../applications/misc/xteddy { };