mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
treewide: format all inactive Nix files
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
This commit is contained in:
parent
b32a094368
commit
4f0dadbf38
21293 changed files with 701351 additions and 428307 deletions
|
@ -1,78 +1,101 @@
|
|||
args@
|
||||
{ system
|
||||
, pkgs ? import ../.. { inherit system config; }
|
||||
args@{
|
||||
system,
|
||||
pkgs ? import ../.. { inherit system config; },
|
||||
# Use a minimal kernel?
|
||||
, minimal ? false
|
||||
minimal ? false,
|
||||
# Ignored
|
||||
, config ? { }
|
||||
config ? { },
|
||||
# !!! See comment about args in lib/modules.nix
|
||||
, specialArgs ? throw "legacy - do not use, see error below"
|
||||
specialArgs ? throw "legacy - do not use, see error below",
|
||||
# Modules to add to each VM
|
||||
, extraConfigurations ? [ ]
|
||||
extraConfigurations ? [ ],
|
||||
}:
|
||||
let
|
||||
nixos-lib = import ./default.nix { inherit (pkgs) lib; };
|
||||
in
|
||||
|
||||
pkgs.lib.throwIf (args?specialArgs) ''
|
||||
testing-python.nix: `specialArgs` is not supported anymore. If you're looking
|
||||
for the public interface to the NixOS test framework, use `runTest`, and
|
||||
`node.specialArgs`.
|
||||
See https://nixos.org/manual/nixos/unstable/index.html#sec-calling-nixos-tests
|
||||
and https://nixos.org/manual/nixos/unstable/index.html#test-opt-node.specialArgs
|
||||
''
|
||||
rec {
|
||||
pkgs.lib.throwIf (args ? specialArgs)
|
||||
''
|
||||
testing-python.nix: `specialArgs` is not supported anymore. If you're looking
|
||||
for the public interface to the NixOS test framework, use `runTest`, and
|
||||
`node.specialArgs`.
|
||||
See https://nixos.org/manual/nixos/unstable/index.html#sec-calling-nixos-tests
|
||||
and https://nixos.org/manual/nixos/unstable/index.html#test-opt-node.specialArgs
|
||||
''
|
||||
rec {
|
||||
|
||||
inherit pkgs;
|
||||
inherit pkgs;
|
||||
|
||||
evalTest = module: nixos-lib.evalTest { imports = [ extraTestModule module ]; };
|
||||
runTest = module: nixos-lib.runTest { imports = [ extraTestModule module ]; };
|
||||
|
||||
extraTestModule = {
|
||||
config = {
|
||||
hostPkgs = pkgs;
|
||||
};
|
||||
};
|
||||
|
||||
# Make a full-blown test (legacy)
|
||||
# For an official public interface to the tests, see
|
||||
# https://nixos.org/manual/nixos/unstable/index.html#sec-calling-nixos-tests
|
||||
makeTest =
|
||||
{ machine ? null
|
||||
, nodes ? {}
|
||||
, testScript
|
||||
, enableOCR ? false
|
||||
, globalTimeout ? (60 * 60)
|
||||
, name ? "unnamed"
|
||||
, skipTypeCheck ? false
|
||||
# Skip linting (mainly intended for faster dev cycles)
|
||||
, skipLint ? false
|
||||
, passthru ? {}
|
||||
, meta ? {}
|
||||
, # For meta.position
|
||||
pos ? # position used in error messages and for meta.position
|
||||
(if meta.description or null != null
|
||||
then builtins.unsafeGetAttrPos "description" meta
|
||||
else builtins.unsafeGetAttrPos "testScript" t)
|
||||
, extraPythonPackages ? (_ : [])
|
||||
, interactive ? {}
|
||||
} @ t: let
|
||||
testConfig =
|
||||
(evalTest {
|
||||
evalTest =
|
||||
module:
|
||||
nixos-lib.evalTest {
|
||||
imports = [
|
||||
{ _file = "makeTest parameters"; config = t; }
|
||||
{
|
||||
defaults = {
|
||||
_file = "makeTest: extraConfigurations";
|
||||
imports = extraConfigurations;
|
||||
};
|
||||
}
|
||||
extraTestModule
|
||||
module
|
||||
];
|
||||
}).config;
|
||||
in
|
||||
testConfig.test # For nix-build
|
||||
// testConfig; # For all-tests.nix
|
||||
};
|
||||
runTest =
|
||||
module:
|
||||
nixos-lib.runTest {
|
||||
imports = [
|
||||
extraTestModule
|
||||
module
|
||||
];
|
||||
};
|
||||
|
||||
simpleTest = as: (makeTest as).test;
|
||||
extraTestModule = {
|
||||
config = {
|
||||
hostPkgs = pkgs;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
# Make a full-blown test (legacy)
|
||||
# For an official public interface to the tests, see
|
||||
# https://nixos.org/manual/nixos/unstable/index.html#sec-calling-nixos-tests
|
||||
makeTest =
|
||||
{
|
||||
machine ? null,
|
||||
nodes ? { },
|
||||
testScript,
|
||||
enableOCR ? false,
|
||||
globalTimeout ? (60 * 60),
|
||||
name ? "unnamed",
|
||||
skipTypeCheck ? false,
|
||||
# Skip linting (mainly intended for faster dev cycles)
|
||||
skipLint ? false,
|
||||
passthru ? { },
|
||||
meta ? { },
|
||||
# For meta.position
|
||||
pos ? # position used in error messages and for meta.position
|
||||
(
|
||||
if meta.description or null != null then
|
||||
builtins.unsafeGetAttrPos "description" meta
|
||||
else
|
||||
builtins.unsafeGetAttrPos "testScript" t
|
||||
),
|
||||
extraPythonPackages ? (_: [ ]),
|
||||
interactive ? { },
|
||||
}@t:
|
||||
let
|
||||
testConfig =
|
||||
(evalTest {
|
||||
imports = [
|
||||
{
|
||||
_file = "makeTest parameters";
|
||||
config = t;
|
||||
}
|
||||
{
|
||||
defaults = {
|
||||
_file = "makeTest: extraConfigurations";
|
||||
imports = extraConfigurations;
|
||||
};
|
||||
}
|
||||
];
|
||||
}).config;
|
||||
in
|
||||
testConfig.test # For nix-build
|
||||
// testConfig; # For all-tests.nix
|
||||
|
||||
simpleTest = as: (makeTest as).test;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue