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

top-level: refactor of all-packages to comply w/ editorconfig-checker

authored by

Graham Christensen and committed by
GitHub
9b92a817 8b9dc097

+146 -148
+146 -148
pkgs/top-level/all-packages.nix
··· 457 457 458 458 # `fetchurl' downloads a file from the network. 459 459 fetchurl = if stdenv.buildPlatform != stdenv.hostPlatform 460 - then buildPackages.fetchurl # No need to do special overrides twice, 461 - else makeOverridable (import ../build-support/fetchurl) { 462 - inherit lib stdenvNoCC buildPackages; 463 - inherit cacert; 464 - curl = buildPackages.curlMinimal.override (old: rec { 465 - # break dependency cycles 466 - fetchurl = stdenv.fetchurlBoot; 467 - zlib = buildPackages.zlib.override { fetchurl = stdenv.fetchurlBoot; }; 468 - pkg-config = buildPackages.pkg-config.override (old: { 469 - pkg-config = old.pkg-config.override { 470 - fetchurl = stdenv.fetchurlBoot; 471 - }; 472 - }); 473 - perl = buildPackages.perl.override { fetchurl = stdenv.fetchurlBoot; }; 474 - openssl = buildPackages.openssl.override { 460 + then buildPackages.fetchurl # No need to do special overrides twice, 461 + else makeOverridable (import ../build-support/fetchurl) { 462 + inherit lib stdenvNoCC buildPackages; 463 + inherit cacert; 464 + curl = buildPackages.curlMinimal.override (old: rec { 465 + # break dependency cycles 475 466 fetchurl = stdenv.fetchurlBoot; 476 - buildPackages = { 477 - coreutils = buildPackages.coreutils.override { 467 + zlib = buildPackages.zlib.override { fetchurl = stdenv.fetchurlBoot; }; 468 + pkg-config = buildPackages.pkg-config.override (old: { 469 + pkg-config = old.pkg-config.override { 478 470 fetchurl = stdenv.fetchurlBoot; 471 + }; 472 + }); 473 + perl = buildPackages.perl.override { fetchurl = stdenv.fetchurlBoot; }; 474 + openssl = buildPackages.openssl.override { 475 + fetchurl = stdenv.fetchurlBoot; 476 + buildPackages = { 477 + coreutils = buildPackages.coreutils.override { 478 + fetchurl = stdenv.fetchurlBoot; 479 + inherit perl; 480 + xz = buildPackages.xz.override { fetchurl = stdenv.fetchurlBoot; }; 481 + gmp = null; 482 + aclSupport = false; 483 + attrSupport = false; 484 + }; 479 485 inherit perl; 480 - xz = buildPackages.xz.override { fetchurl = stdenv.fetchurlBoot; }; 481 - gmp = null; 482 - aclSupport = false; 483 - attrSupport = false; 484 486 }; 485 487 inherit perl; 486 488 }; 487 - inherit perl; 488 - }; 489 - libssh2 = buildPackages.libssh2.override { 490 - fetchurl = stdenv.fetchurlBoot; 491 - inherit zlib openssl; 492 - }; 493 - # On darwin, libkrb5 needs bootstrap_cmds which would require 494 - # converting many packages to fetchurl_boot to avoid evaluation cycles. 495 - # So turn gssSupport off there, and on Windows. 496 - # On other platforms, keep the previous value. 497 - gssSupport = 498 - if stdenv.isDarwin || stdenv.hostPlatform.isWindows 499 - then false 500 - else old.gssSupport or true; # `? true` is the default 501 - libkrb5 = buildPackages.libkrb5.override { 502 - fetchurl = stdenv.fetchurlBoot; 503 - inherit pkg-config perl openssl; 504 - keyutils = buildPackages.keyutils.override { fetchurl = stdenv.fetchurlBoot; }; 505 - }; 506 - nghttp2 = buildPackages.nghttp2.override { 507 - fetchurl = stdenv.fetchurlBoot; 508 - inherit zlib pkg-config openssl; 509 - c-ares = buildPackages.c-ares.override { fetchurl = stdenv.fetchurlBoot; }; 510 - libev = buildPackages.libev.override { fetchurl = stdenv.fetchurlBoot; }; 511 - }; 512 - }); 513 - }; 489 + libssh2 = buildPackages.libssh2.override { 490 + fetchurl = stdenv.fetchurlBoot; 491 + inherit zlib openssl; 492 + }; 493 + # On darwin, libkrb5 needs bootstrap_cmds which would require 494 + # converting many packages to fetchurl_boot to avoid evaluation cycles. 495 + # So turn gssSupport off there, and on Windows. 496 + # On other platforms, keep the previous value. 497 + gssSupport = 498 + if stdenv.isDarwin || stdenv.hostPlatform.isWindows 499 + then false 500 + else old.gssSupport or true; # `? true` is the default 501 + libkrb5 = buildPackages.libkrb5.override { 502 + fetchurl = stdenv.fetchurlBoot; 503 + inherit pkg-config perl openssl; 504 + keyutils = buildPackages.keyutils.override { fetchurl = stdenv.fetchurlBoot; }; 505 + }; 506 + nghttp2 = buildPackages.nghttp2.override { 507 + fetchurl = stdenv.fetchurlBoot; 508 + inherit zlib pkg-config openssl; 509 + c-ares = buildPackages.c-ares.override { fetchurl = stdenv.fetchurlBoot; }; 510 + libev = buildPackages.libev.override { fetchurl = stdenv.fetchurlBoot; }; 511 + }; 512 + }); 513 + }; 514 514 515 515 fetchRepoProject = callPackage ../build-support/fetchrepoproject { }; 516 516 ··· 1470 1470 grc = python3Packages.callPackage ../tools/misc/grc { }; 1471 1471 1472 1472 green-pdfviewer = callPackage ../applications/misc/green-pdfviewer { 1473 - SDL = SDL_sixel; 1473 + SDL = SDL_sixel; 1474 1474 }; 1475 1475 1476 1476 gremlin-console = callPackage ../applications/misc/gremlin-console { ··· 4233 4233 wallutils = callPackage ../tools/graphics/wallutils { }; 4234 4234 4235 4235 wrangler = callPackage ../development/tools/wrangler { 4236 - inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Security; 4236 + inherit (darwin.apple_sdk.frameworks) CoreFoundation CoreServices Security; 4237 4237 }; 4238 4238 4239 4239 wsl-open = callPackage ../tools/misc/wsl-open { }; ··· 5145 5145 5146 5146 gnu-pw-mgr = callPackage ../tools/security/gnu-pw-mgr { }; 5147 5147 5148 - gnused = if !stdenv.hostPlatform.isWindows then 5149 - callPackage ../tools/text/gnused { } # broken on Windows 5150 - else 5151 - gnused_422; 5148 + gnused = if !stdenv.hostPlatform.isWindows 5149 + then callPackage ../tools/text/gnused { } # broken on Windows 5150 + else gnused_422; 5152 5151 # This is an easy work-around for [:space:] problems. 5153 5152 gnused_422 = callPackage ../tools/text/gnused/422.nix { }; 5154 5153 ··· 10451 10450 10452 10451 crossLibcStdenv = overrideCC stdenv 10453 10452 (if stdenv.hostPlatform.useLLVM or false 10454 - then buildPackages.llvmPackages_8.lldClangNoLibc 10455 - else buildPackages.gccCrossStageStatic); 10453 + then buildPackages.llvmPackages_8.lldClangNoLibc 10454 + else buildPackages.gccCrossStageStatic); 10456 10455 10457 10456 # The GCC used to build libc for the target platform. Normal gccs will be 10458 10457 # built with, and use, that cross-compiled libc. ··· 11274 11273 mint = callPackage ../development/compilers/mint { }; 11275 11274 11276 11275 mitscheme = callPackage ../development/compilers/mit-scheme { 11277 - texLive = texlive.combine { inherit (texlive) scheme-small; }; 11278 - texinfo = texinfo5; 11279 - xlibsWrapper = null; 11276 + texLive = texlive.combine { inherit (texlive) scheme-small; }; 11277 + texinfo = texinfo5; 11278 + xlibsWrapper = null; 11280 11279 }; 11281 11280 11282 11281 mitschemeX11 = mitscheme.override { 11283 - texLive = texlive.combine { inherit (texlive) scheme-small; }; 11284 - texinfo = texinfo5; 11285 - enableX11 = true; 11282 + texLive = texlive.combine { inherit (texlive) scheme-small; }; 11283 + texinfo = texinfo5; 11284 + enableX11 = true; 11286 11285 }; 11287 11286 11288 11287 miranda = callPackage ../development/compilers/miranda {}; ··· 12916 12915 # }; 12917 12916 # 12918 12917 distccWrapper = makeOverridable ({ extraConfig ? "" }: 12919 - wrapCC (distcc.links extraConfig)) {}; 12918 + wrapCC (distcc.links extraConfig)) {}; 12920 12919 distccStdenv = lowPrio (overrideCC stdenv buildPackages.distccWrapper); 12921 12920 12922 12921 distccMasquerade = if stdenv.isDarwin ··· 16062 16061 libiconv = 16063 16062 if lib.elem stdenv.hostPlatform.libc ["glibc" "musl" "wasilibc"] 16064 16063 then glibcIconv (if stdenv.hostPlatform != stdenv.buildPlatform 16065 - then libcCross 16066 - else stdenv.cc.libc) 16064 + then libcCross 16065 + else stdenv.cc.libc) 16067 16066 else if stdenv.hostPlatform.isDarwin 16068 16067 then darwin.libiconv 16069 16068 else libiconvReal; ··· 17520 17519 17521 17520 s2geometry = callPackage ../development/libraries/s2geometry { }; 17522 17521 17523 - /* This package references ghc844, which we no longer have. Unfortunately, I 17524 - have been unable to mark it as "broken" in a way that the ofBorg bot 17525 - recognizes. Since I don't want to merge code into master that generates 17526 - evaluation errors, I have no other idea but to comment it out entirely. 17522 + /* This package references ghc844, which we no longer have. Unfortunately, I 17523 + have been unable to mark it as "broken" in a way that the ofBorg bot 17524 + recognizes. Since I don't want to merge code into master that generates 17525 + evaluation errors, I have no other idea but to comment it out entirely. 17527 17526 17528 17527 sad = callPackage ../applications/science/logic/sad { }; 17529 - */ 17528 + */ 17530 17529 17531 17530 safefile = callPackage ../development/libraries/safefile {}; 17532 17531 ··· 20253 20252 ]; 20254 20253 }; 20255 20254 20256 - /* Linux kernel modules are inherently tied to a specific kernel. So 20257 - rather than provide specific instances of those packages for a 20258 - specific kernel, we have a function that builds those packages 20259 - for a specific kernel. This function can then be called for 20260 - whatever kernel you're using. */ 20255 + /* Linux kernel modules are inherently tied to a specific kernel. So 20256 + rather than provide specific instances of those packages for a 20257 + specific kernel, we have a function that builds those packages 20258 + for a specific kernel. This function can then be called for 20259 + whatever kernel you're using. */ 20261 20260 20262 20261 linuxPackagesFor = kernel_: lib.makeExtensible (self: with self; { 20263 20262 callPackage = newScope self; ··· 20397 20396 20398 20397 mxu11x0 = callPackage ../os-specific/linux/mxu11x0 { }; 20399 20398 20400 - /* compiles but has to be integrated into the kernel somehow 20401 - Let's have it uncommented and finish it.. 20402 - */ 20399 + # compiles but has to be integrated into the kernel somehow 20400 + # Let's have it uncommented and finish it.. 20403 20401 ndiswrapper = callPackage ../os-specific/linux/ndiswrapper { }; 20404 20402 20405 20403 netatop = callPackage ../os-specific/linux/netatop { }; ··· 20458 20456 zenpower = callPackage ../os-specific/linux/zenpower { }; 20459 20457 20460 20458 inherit (callPackages ../os-specific/linux/zfs { 20461 - configFile = "kernel"; 20462 - inherit kernel; 20463 - }) zfsStable zfsUnstable; 20459 + configFile = "kernel"; 20460 + inherit kernel; 20461 + }) zfsStable zfsUnstable; 20462 + zfs = zfsStable; 20464 20463 20465 - zfs = zfsStable; 20466 - 20467 - can-isotp = callPackage ../os-specific/linux/can-isotp { }; 20464 + can-isotp = callPackage ../os-specific/linux/can-isotp { }; 20468 20465 }); 20469 20466 20470 20467 # The current default kernel / kernel modules. ··· 20709 20706 inherit (darwin.apple_sdk.frameworks) AppKit Security; 20710 20707 }; 20711 20708 20712 - nettools = if stdenv.isLinux then callPackage ../os-specific/linux/net-tools { } 20713 - else unixtools.nettools; 20709 + nettools = if stdenv.isLinux 20710 + then callPackage ../os-specific/linux/net-tools { } 20711 + else unixtools.nettools; 20714 20712 20715 20713 nettools_mptcp = callPackage ../os-specific/linux/net-tools/mptcp.nix { }; 20716 20714 ··· 20909 20907 20910 20908 prayer = callPackage ../servers/prayer { }; 20911 20909 20912 - procps = if stdenv.isLinux then callPackage ../os-specific/linux/procps-ng { } 20913 - else unixtools.procps; 20910 + procps = if stdenv.isLinux 20911 + then callPackage ../os-specific/linux/procps-ng { } 20912 + else unixtools.procps; 20914 20913 20915 20914 procdump = callPackage ../os-specific/linux/procdump { }; 20916 20915 ··· 22060 22059 ucs-fonts = callPackage ../data/fonts/ucs-fonts 22061 22060 { inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; 22062 22061 22063 - 22064 22062 ultimate-oldschool-pc-font-pack = callPackage ../data/fonts/ultimate-oldschool-pc-font-pack { }; 22065 22063 22066 22064 ultralist = callPackage ../applications/misc/ultralist { }; ··· 22068 22066 undefined-medium = callPackage ../data/fonts/undefined-medium { }; 22069 22067 22070 22068 uni-vga = callPackage ../data/fonts/uni-vga 22071 - { inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; 22069 + { inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; 22072 22070 22073 22071 unicode-character-database = callPackage ../data/misc/unicode-character-database { }; 22074 22072 ··· 22077 22075 unihan-database = callPackage ../data/misc/unihan-database { }; 22078 22076 22079 22077 unifont = callPackage ../data/fonts/unifont 22080 - { inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; 22078 + { inherit (buildPackages.xorg) fonttosfnt mkfontscale; }; 22081 22079 22082 22080 unifont_upper = callPackage ../data/fonts/unifont_upper { }; 22083 22081 ··· 23108 23106 flwrap = callPackage ../applications/radio/flwrap { }; 23109 23107 23110 23108 fluidsynth = callPackage ../applications/audio/fluidsynth { 23111 - inherit (darwin.apple_sdk.frameworks) AudioUnit CoreAudio CoreMIDI CoreServices; 23109 + inherit (darwin.apple_sdk.frameworks) AudioUnit CoreAudio CoreMIDI CoreServices; 23112 23110 }; 23113 23111 fluidsynth_1 = fluidsynth.override { version = "1"; }; 23114 23112 ··· 25105 25103 25106 25104 plank = callPackage ../applications/misc/plank { }; 25107 25105 25108 - playonlinux = callPackage ../applications/misc/playonlinux { 25109 - stdenv = stdenv_32bit; 25110 - }; 25106 + playonlinux = callPackage ../applications/misc/playonlinux 25107 + { stdenv = stdenv_32bit; }; 25111 25108 25112 25109 pleroma-bot = python3Packages.callPackage ../development/python-modules/pleroma-bot { }; 25113 25110 ··· 27510 27507 zgrviewer = callPackage ../applications/graphics/zgrviewer { }; 27511 27508 27512 27509 zgv = callPackage ../applications/graphics/zgv { 27513 - # Enable the below line for terminal display. Note 27514 - # that it requires sixel graphics compatible terminals like mlterm 27515 - # or xterm -ti 340 27516 - SDL = SDL_sixel; 27510 + # Enable the below line for terminal display. Note 27511 + # that it requires sixel graphics compatible terminals like mlterm 27512 + # or xterm -ti 340 27513 + SDL = SDL_sixel; 27517 27514 }; 27518 27515 27519 27516 zim = callPackage ../applications/office/zim { }; ··· 29444 29441 elan = callPackage ../applications/science/logic/elan {}; 29445 29442 mathlibtools = with python3Packages; toPythonApplication mathlibtools; 29446 29443 29447 - leo2 = callPackage ../applications/science/logic/leo2 { 29448 - ocaml = ocaml-ng.ocamlPackages_4_01_0.ocaml;}; 29444 + leo2 = callPackage ../applications/science/logic/leo2 29445 + { ocaml = ocaml-ng.ocamlPackages_4_01_0.ocaml; }; 29449 29446 29450 29447 leo3-bin = callPackage ../applications/science/logic/leo3/binary.nix {}; 29451 29448 ··· 30241 30238 30242 30239 nixops-dns = callPackage ../tools/package-management/nixops/nixops-dns.nix { }; 30243 30240 30244 - /* Evaluate a NixOS configuration using this evaluation of Nixpkgs. 30241 + /* 30242 + Evaluate a NixOS configuration using this evaluation of Nixpkgs. 30245 30243 30246 - With this function you can write, for example, a package that 30247 - depends on a custom virtual machine image. 30244 + With this function you can write, for example, a package that 30245 + depends on a custom virtual machine image. 30248 30246 30249 - Parameter: A module, path or list of those that represent the 30247 + Parameter: A module, path or list of those that represent the 30250 30248 configuration of the NixOS system to be constructed. 30251 30249 30252 - Result: An attribute set containing packages produced by this 30253 - evaluation of NixOS, such as toplevel, kernel and 30254 - initialRamdisk. 30255 - The result can be extended in the modules by defining 30256 - extra attributes in system.build. 30257 - Alternatively, you may use the result's config and 30258 - options attributes to query any option. 30250 + Result: An attribute set containing packages produced by this 30251 + evaluation of NixOS, such as toplevel, kernel and 30252 + initialRamdisk. 30253 + The result can be extended in the modules by defining 30254 + extra attributes in system.build. 30255 + Alternatively, you may use the result's config and 30256 + options attributes to query any option. 30259 30257 30260 - Example: 30258 + Example: 30261 30259 30262 - let 30263 - myOS = pkgs.nixos ({ lib, pkgs, config, ... }: { 30260 + let 30261 + myOS = pkgs.nixos ({ lib, pkgs, config, ... }: { 30264 30262 30265 - config.services.nginx = { 30266 - enable = true; 30267 - # ... 30268 - }; 30263 + config.services.nginx = { 30264 + enable = true; 30265 + # ... 30266 + }; 30269 30267 30270 - # Use config.system.build to exports relevant parts of a 30271 - # configuration. The runner attribute should not be 30272 - # considered a fully general replacement for systemd 30273 - # functionality. 30274 - config.system.build.run-nginx = config.systemd.services.nginx.runner; 30275 - }); 30276 - in 30277 - myOS.run-nginx 30268 + # Use config.system.build to exports relevant parts of a 30269 + # configuration. The runner attribute should not be 30270 + # considered a fully general replacement for systemd 30271 + # functionality. 30272 + config.system.build.run-nginx = config.systemd.services.nginx.runner; 30273 + }); 30274 + in 30275 + myOS.run-nginx 30278 30276 30279 - Unlike in plain NixOS, the nixpkgs.config and 30280 - nixpkgs.system options will be ignored by default. Instead, 30281 - nixpkgs.pkgs will have the default value of pkgs as it was 30282 - constructed right after invoking the nixpkgs function (e.g. the 30283 - value of import <nixpkgs> { overlays = [./my-overlay.nix]; } 30284 - but not the value of (import <nixpkgs> {} // { extra = ...; }). 30277 + Unlike in plain NixOS, the nixpkgs.config and 30278 + nixpkgs.system options will be ignored by default. Instead, 30279 + nixpkgs.pkgs will have the default value of pkgs as it was 30280 + constructed right after invoking the nixpkgs function (e.g. the 30281 + value of import <nixpkgs> { overlays = [./my-overlay.nix]; } 30282 + but not the value of (import <nixpkgs> {} // { extra = ...; }). 30285 30283 30286 - If you do want to use the config.nixpkgs options, you are 30287 - probably better off by calling nixos/lib/eval-config.nix 30288 - directly, even though it is possible to set config.nixpkgs.pkgs. 30284 + If you do want to use the config.nixpkgs options, you are 30285 + probably better off by calling nixos/lib/eval-config.nix 30286 + directly, even though it is possible to set config.nixpkgs.pkgs. 30289 30287 30290 - For more information about writing NixOS modules, see 30291 - https://nixos.org/nixos/manual/index.html#sec-writing-modules 30288 + For more information about writing NixOS modules, see 30289 + https://nixos.org/nixos/manual/index.html#sec-writing-modules 30292 30290 30293 - Note that you will need to have called Nixpkgs with the system 30294 - parameter set to the right value for your deployment target. 30291 + Note that you will need to have called Nixpkgs with the system 30292 + parameter set to the right value for your deployment target. 30295 30293 */ 30296 30294 nixos = 30297 30295 configuration: ··· 30359 30357 test: 30360 30358 let 30361 30359 loadedTest = if builtins.typeOf test == "path" 30362 - then import test 30363 - else test; 30360 + then import test 30361 + else test; 30364 30362 calledTest = if pkgs.lib.isFunction loadedTest 30365 - then callPackage loadedTest {} 30366 - else loadedTest; 30363 + then callPackage loadedTest {} 30364 + else loadedTest; 30367 30365 in 30368 30366 nixosTesting.makeTest calledTest; 30369 30367 ··· 31023 31021 }; 31024 31022 31025 31023 xsw = callPackage ../applications/misc/xsw { 31026 - # Enable the next line to use this in terminal. 31027 - # Note that it requires sixel capable terminals such as mlterm 31028 - # or xterm -ti 340 31029 - SDL = SDL_sixel; 31024 + # Enable the next line to use this in terminal. 31025 + # Note that it requires sixel capable terminals such as mlterm 31026 + # or xterm -ti 340 31027 + SDL = SDL_sixel; 31030 31028 }; 31031 31029 31032 31030 xteddy = callPackage ../applications/misc/xteddy { };