From fce8b018f06431e7684b725a520416ff3862db9f Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 25 Jun 2022 13:53:02 +0200 Subject: [PATCH 001/113] lib: Add lazyDerivation --- lib/default.nix | 2 + lib/derivations.nix | 101 ++++++++++++++++++++++++++++++++++++++++++++ lib/tests/misc.nix | 53 +++++++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 lib/derivations.nix diff --git a/lib/default.nix b/lib/default.nix index e2a93e63ac1f..0c0e2d5e1021 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -23,6 +23,7 @@ let # packaging customisation = callLibs ./customisation.nix; + derivations = callLibs ./derivations.nix; maintainers = import ../maintainers/maintainer-list.nix; teams = callLibs ../maintainers/team-list.nix; meta = callLibs ./meta.nix; @@ -108,6 +109,7 @@ let inherit (self.customisation) overrideDerivation makeOverridable callPackageWith callPackagesWith extendDerivation hydraJob makeScope makeScopeWithSplicing; + inherit (self.derivations) lazyDerivation; inherit (self.meta) addMetaAttrs dontDistribute setName updateName appendToName mapDerivationAttrset setPrio lowPrio lowPrioSet hiPrio hiPrioSet getLicenseFromSpdxId getExe; diff --git a/lib/derivations.nix b/lib/derivations.nix new file mode 100644 index 000000000000..9a88087f2e34 --- /dev/null +++ b/lib/derivations.nix @@ -0,0 +1,101 @@ +{ lib }: + +let + inherit (lib) throwIfNot; +in +{ + /* + Restrict a derivation to a predictable set of attribute names, so + that the returned attrset is not strict in the actual derivation, + saving a lot of computation when the derivation is non-trivial. + + This is useful in situations where a derivation might only be used for its + passthru attributes, improving evaluation performance. + + The returned attribute set is lazy in `derivation`. Specifically, this + means that the derivation will not be evaluated in at least the + situations below. + + For illustration and/or testing, we define derivation such that its + evaluation is very noticable. + + let derivation = throw "This won't be evaluated."; + + In the following expressions, `derivation` will _not_ be evaluated: + + (lazyDerivation { inherit derivation; }).type + + attrNames (lazyDerivation { inherit derivation; }) + + (lazyDerivation { inherit derivation; } // { foo = true; }).foo + + (lazyDerivation { inherit derivation; meta.foo = true; }).meta + + In these expressions, it `derivation` _will_ be evaluated: + + "${lazyDerivation { inherit derivation }}" + + (lazyDerivation { inherit derivation }).outPath + + (lazyDerivation { inherit derivation }).meta + + And the following expressions are not valid, because the refer to + implementation details and/or attributes that may not be present on + some derivations: + + (lazyDerivation { inherit derivation }).buildInputs + + (lazyDerivation { inherit derivation }).passthru + + (lazyDerivation { inherit derivation }).pythonPath + + */ + lazyDerivation = + args@{ + # The derivation to be wrapped. + derivation + , # Optional meta attribute. + # + # While this function is primarily about derivations, it can improve + # the `meta` package attribute, which is usually specified through + # `mkDerivation`. + meta ? null + , # Optional extra values to add to the returned attrset. + # + # This can be used for adding package attributes, such as `tests`. + passthru ? { } + }: + let + # These checks are strict in `drv` and some `drv` attributes, but the + # attrset spine returned by lazyDerivation does not depend on it. + # Instead, the individual derivation attributes do depend on it. + checked = + throwIfNot (derivation.type or null == "derivation") + "lazySimpleDerivation: input must be a derivation." + throwIfNot + (derivation.outputs == [ "out" ]) + # Supporting multiple outputs should be a matter of inheriting more attrs. + "The derivation ${derivation.name or ""} has multiple outputs. This is not supported by lazySimpleDerivation yet. Support could be added, and be useful as long as the set of outputs is known in advance, without evaluating the actual derivation." + derivation; + in + { + # Hardcoded `type` + # + # `lazyDerivation` requires its `derivation` argument to be a derivation, + # so if it is not, that is a programming error by the caller and not + # something that `lazyDerivation` consumers should be able to correct + # for after the fact. + # So, to improve laziness, we assume correctness here and check it only + # when actual derivation values are accessed later. + type = "derivation"; + + # A fixed set of derivation values, so that `lazyDerivation` can return + # its attrset before evaluating `derivation`. + # This must only list attributes that are available on _all_ derivations. + inherit (checked) outputs out outPath outputName drvPath name system; + + # The meta attribute can either be taken from the derivation, or if the + # `lazyDerivation` caller knew a shortcut, be taken from there. + meta = args.meta or checked.meta; + } // passthru; +} diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index 9b1397a7915a..74020bc7c8e5 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -1207,6 +1207,59 @@ runTests { expected = true; }; + # lazyDerivation + + testLazyDerivationIsLazyInDerivationForAttrNames = { + expr = attrNames (lazyDerivation { + derivation = throw "not lazy enough"; + }); + # It's ok to add attribute names here when lazyDerivation is improved + # in accordance with its inline comments. + expected = [ "drvPath" "meta" "name" "out" "outPath" "outputName" "outputs" "system" "type" ]; + }; + + testLazyDerivationIsLazyInDerivationForPassthruAttr = { + expr = (lazyDerivation { + derivation = throw "not lazy enough"; + passthru.tests = "whatever is in tests"; + }).tests; + expected = "whatever is in tests"; + }; + + testLazyDerivationIsLazyInDerivationForPassthruAttr2 = { + # passthru.tests is not a special case. It works for any attr. + expr = (lazyDerivation { + derivation = throw "not lazy enough"; + passthru.foo = "whatever is in foo"; + }).foo; + expected = "whatever is in foo"; + }; + + testLazyDerivationIsLazyInDerivationForMeta = { + expr = (lazyDerivation { + derivation = throw "not lazy enough"; + meta = "whatever is in meta"; + }).meta; + expected = "whatever is in meta"; + }; + + testLazyDerivationReturnsDerivationAttrs = let + derivation = { + type = "derivation"; + outputs = ["out"]; + out = "test out"; + outPath = "test outPath"; + outputName = "out"; + drvPath = "test drvPath"; + name = "test name"; + system = "test system"; + meta = "test meta"; + }; + in { + expr = lazyDerivation { inherit derivation; }; + expected = derivation; + }; + testTypeDescriptionInt = { expr = (with types; int).description; expected = "signed integer"; From 1ffa30b0559a05e810a3db663da5066953d4f05a Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 6 Jun 2022 16:05:21 +0200 Subject: [PATCH 002/113] lib/modules: Fix meta duplication in shorthand syntax --- lib/modules.nix | 3 ++- lib/tests/modules.sh | 3 +++ lib/tests/modules/shorthand-meta.nix | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 lib/tests/modules/shorthand-meta.nix diff --git a/lib/modules.nix b/lib/modules.nix index d3a7fac82c4a..28c8da9e923a 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -440,13 +440,14 @@ rec { config = addFreeformType (addMeta (m.config or {})); } else + # shorthand syntax lib.throwIfNot (isAttrs m) "module ${file} (${key}) does not look like a module." { _file = toString m._file or file; key = toString m.key or key; disabledModules = m.disabledModules or []; imports = m.require or [] ++ m.imports or []; options = {}; - config = addFreeformType (addMeta (removeAttrs m ["_file" "key" "disabledModules" "require" "imports" "freeformType"])); + config = addFreeformType (removeAttrs m ["_file" "key" "disabledModules" "require" "imports" "freeformType"]); }; applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index 2ef7c4806595..57d3b5a76cec 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -58,6 +58,9 @@ checkConfigError() { fi } +# Shorthand meta attribute does not duplicate the config +checkConfigOutput '^"one two"$' config.result ./shorthand-meta.nix + # Check boolean option. checkConfigOutput '^false$' config.enable ./declare-enable.nix checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*: true' config.enable ./define-enable.nix diff --git a/lib/tests/modules/shorthand-meta.nix b/lib/tests/modules/shorthand-meta.nix new file mode 100644 index 000000000000..8c9619e18a2a --- /dev/null +++ b/lib/tests/modules/shorthand-meta.nix @@ -0,0 +1,19 @@ +{ lib, ... }: +let + inherit (lib) types mkOption; +in +{ + imports = [ + ({ config, ... }: { + options = { + meta.foo = mkOption { + type = types.listOf types.str; + }; + result = mkOption { default = lib.concatStringsSep " " config.meta.foo; }; + }; + }) + { + meta.foo = [ "one" "two" ]; + } + ]; +} From b3de22483cfd40e52dbe6fe7317b0f4901bd957d Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 6 Jun 2022 13:29:04 +0200 Subject: [PATCH 003/113] nixos/testing-python.nix: Add evalTest This is a decomposition of the testing-python.nix and build-vms.nix files into modules. By refactoring the glue, we accomplish the following: - NixOS tests can now use `imports` and other module system features. - Network-wide test setup can now be reusable; example: - A setup with all VMs configured to use a DNS server - Split long, slow tests into multiple tests that import a common module that has most of the setup. - Type checking for the test arguments - (TBD) "generated" options reference docs - Aspects that had to be wired through all the glue are now in their own files. - Chief example: interactive.nix. - Also: network.nix In rewriting this, I've generally stuck as close as possible to the existing code; copying pieces of logic and rewiring them, without changing the logic itself. I've made two exceptions to this rule - Introduction of `extraDriverArgs` instead of hardcoded interactivity logic. - Incorporation of https://github.com/NixOS/nixpkgs/pull/144110 in testScript.nix. I might revert the latter and split it into a new commit. --- nixos/lib/testing-python.nix | 20 ++++ nixos/lib/testing/call-test.nix | 16 +++ nixos/lib/testing/driver.nix | 177 ++++++++++++++++++++++++++++++ nixos/lib/testing/interactive.nix | 18 +++ nixos/lib/testing/legacy.nix | 25 +++++ nixos/lib/testing/meta.nix | 12 ++ nixos/lib/testing/name.nix | 7 ++ nixos/lib/testing/network.nix | 75 +++++++++++++ nixos/lib/testing/nodes.nix | 91 +++++++++++++++ nixos/lib/testing/run.nix | 51 +++++++++ nixos/lib/testing/testScript.nix | 78 +++++++++++++ 11 files changed, 570 insertions(+) create mode 100644 nixos/lib/testing/call-test.nix create mode 100644 nixos/lib/testing/driver.nix create mode 100644 nixos/lib/testing/interactive.nix create mode 100644 nixos/lib/testing/legacy.nix create mode 100644 nixos/lib/testing/meta.nix create mode 100644 nixos/lib/testing/name.nix create mode 100644 nixos/lib/testing/network.nix create mode 100644 nixos/lib/testing/nodes.nix create mode 100644 nixos/lib/testing/run.nix create mode 100644 nixos/lib/testing/testScript.nix diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index 4bb1689ffd78..ab509c098d24 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -166,6 +166,26 @@ rec { ${lib.optionalString (interactive) "--add-flags --interactive"} ''); + evalTest = module: lib.evalModules { modules = testModules ++ [ module ]; }; + runTest = module: (evalTest module).config.run; + + testModules = [ + ./testing/driver.nix + ./testing/interactive.nix + ./testing/legacy.nix + ./testing/meta.nix + ./testing/name.nix + ./testing/network.nix + ./testing/nodes.nix + ./testing/run.nix + ./testing/testScript.nix + { + config = { + hostPkgs = pkgs; + }; + } + ]; + # Make a full-blown test makeTest = { machine ? null diff --git a/nixos/lib/testing/call-test.nix b/nixos/lib/testing/call-test.nix new file mode 100644 index 000000000000..3e137e78cd47 --- /dev/null +++ b/nixos/lib/testing/call-test.nix @@ -0,0 +1,16 @@ +{ config, lib, ... }: +let + inherit (lib) mkOption types; +in +{ + options = { + callTest = mkOption { + internal = true; + type = types.functionTo types.raw; + }; + result = mkOption { + internal = true; + default = config; + }; + }; +} diff --git a/nixos/lib/testing/driver.nix b/nixos/lib/testing/driver.nix new file mode 100644 index 000000000000..9473d888cbb8 --- /dev/null +++ b/nixos/lib/testing/driver.nix @@ -0,0 +1,177 @@ +{ config, lib, hostPkgs, ... }: +let + inherit (lib) mkOption types; + + # Reifies and correctly wraps the python test driver for + # the respective qemu version and with or without ocr support + testDriver = hostPkgs.callPackage ../test-driver { + inherit (config) enableOCR extraPythonPackages; + qemu_pkg = config.qemu.package; + imagemagick_light = hostPkgs.imagemagick_light.override { inherit (hostPkgs) libtiff; }; + tesseract4 = hostPkgs.tesseract4.override { enableLanguages = [ "eng" ]; }; + }; + + + vlans = map (m: m.virtualisation.vlans) (lib.attrValues config.nodes); + vms = map (m: m.system.build.vm) (lib.attrValues config.nodes); + + nodeHostNames = + let + nodesList = map (c: c.system.name) (lib.attrValues config.nodes); + in + nodesList ++ lib.optional (lib.length nodesList == 1 && !lib.elem "machine" nodesList) "machine"; + + # TODO: This is an implementation error and needs fixing + # the testing famework cannot legitimately restrict hostnames further + # beyond RFC1035 + invalidNodeNames = lib.filter + (node: builtins.match "^[A-z_]([A-z0-9_]+)?$" node == null) + nodeHostNames; + + uniqueVlans = lib.unique (builtins.concatLists vlans); + vlanNames = map (i: "vlan${toString i}: VLan;") uniqueVlans; + machineNames = map (name: "${name}: Machine;") nodeHostNames; + + withChecks = + if lib.length invalidNodeNames > 0 then + throw '' + Cannot create machines out of (${lib.concatStringsSep ", " invalidNodeNames})! + All machines are referenced as python variables in the testing framework which will break the + script when special characters are used. + + This is an IMPLEMENTATION ERROR and needs to be fixed. Meanwhile, + please stick to alphanumeric chars and underscores as separation. + '' + else + lib.warnIf config.skipLint "Linting is disabled"; + + driver = + hostPkgs.runCommand "nixos-test-driver-${config.name}" + { + # inherit testName; TODO (roberth): need this? + nativeBuildInputs = [ + hostPkgs.makeWrapper + ] ++ lib.optionals (!config.skipTypeCheck) [ hostPkgs.mypy ]; + testScript = config.testScriptString; + preferLocalBuild = true; + passthru = config.passthru; + meta = config.meta // { + mainProgram = "nixos-test-driver"; + }; + } + '' + mkdir -p $out/bin + + vmStartScripts=($(for i in ${toString vms}; do echo $i/bin/run-*-vm; done)) + + ${lib.optionalString (!config.skipTypeCheck) '' + # prepend type hints so the test script can be type checked with mypy + cat "${../test-script-prepend.py}" >> testScriptWithTypes + echo "${builtins.toString machineNames}" >> testScriptWithTypes + echo "${builtins.toString vlanNames}" >> testScriptWithTypes + echo -n "$testScript" >> testScriptWithTypes + + cat -n testScriptWithTypes + + # set pythonpath so mypy knows where to find the imports. this requires the py.typed file. + export PYTHONPATH='${../test-driver}' + mypy --no-implicit-optional \ + --pretty \ + --no-color-output \ + testScriptWithTypes + unset PYTHONPATH + ''} + + echo -n "$testScript" >> $out/test-script + + ln -s ${testDriver}/bin/nixos-test-driver $out/bin/nixos-test-driver + + ${testDriver}/bin/generate-driver-symbols + ${lib.optionalString (!config.skipLint) '' + PYFLAKES_BUILTINS="$( + echo -n ${lib.escapeShellArg (lib.concatStringsSep "," nodeHostNames)}, + < ${lib.escapeShellArg "driver-symbols"} + )" ${hostPkgs.python3Packages.pyflakes}/bin/pyflakes $out/test-script + ''} + + # set defaults through environment + # see: ./test-driver/test-driver.py argparse implementation + wrapProgram $out/bin/nixos-test-driver \ + --set startScripts "''${vmStartScripts[*]}" \ + --set testScript "$out/test-script" \ + --set vlans '${toString vlans}' \ + ${lib.escapeShellArgs (lib.concatMap (arg: ["--add-flags" arg]) config.extraDriverArgs)} + ''; + +in +{ + options = { + + driver = mkOption { + description = "Script that runs the test."; + type = types.package; + defaultText = lib.literalDocBook "set by the test framework"; + }; + + hostPkgs = mkOption { + description = "Nixpkgs attrset used outside the nodes."; + type = types.raw; + example = lib.literalExpression '' + import nixpkgs { inherit system config overlays; } + ''; + }; + + qemu.package = mkOption { + description = "Which qemu package to use."; + type = types.package; + default = hostPkgs.qemu_test; + defaultText = "hostPkgs.qemu_test"; + }; + + enableOCR = mkOption { + description = '' + Whether to enable Optical Character Recognition functionality for + testing graphical programs. + ''; + type = types.bool; + default = false; + }; + + extraPythonPackages = mkOption { + description = '' + Python packages to add to the test driver. + + The argument is a Python package set, similar to `pkgs.pythonPackages`. + ''; + type = types.functionTo (types.listOf types.package); + default = ps: [ ]; + }; + + extraDriverArgs = mkOption { + description = '' + Extra arguments to pass to the test driver. + ''; + type = types.listOf types.str; + default = []; + }; + + skipLint = mkOption { + type = types.bool; + default = false; + }; + + skipTypeCheck = mkOption { + type = types.bool; + default = false; + }; + }; + + config = { + _module.args.hostPkgs = config.hostPkgs; + + driver = withChecks driver; + + # make available on the test runner + passthru.driver = config.driver; + }; +} diff --git a/nixos/lib/testing/interactive.nix b/nixos/lib/testing/interactive.nix new file mode 100644 index 000000000000..fd4d481a3f82 --- /dev/null +++ b/nixos/lib/testing/interactive.nix @@ -0,0 +1,18 @@ +{ config, lib, moduleType, hostPkgs, ... }: +let + inherit (lib) mkOption types; +in +{ + options = { + interactive = mkOption { + description = "All the same options, but configured for interactive use."; + type = moduleType; + }; + }; + + config = { + interactive.qemu.package = hostPkgs.qemu; + interactive.extraDriverArgs = [ "--interactive" ]; + passthru.driverInteractive = config.interactive.driver; + }; +} diff --git a/nixos/lib/testing/legacy.nix b/nixos/lib/testing/legacy.nix new file mode 100644 index 000000000000..868b8b65b17d --- /dev/null +++ b/nixos/lib/testing/legacy.nix @@ -0,0 +1,25 @@ +{ config, options, lib, ... }: +let + inherit (lib) mkIf mkOption types; +in +{ + # This needs options.warnings, which we don't have (yet?). + # imports = [ + # (lib.mkRenamedOptionModule [ "machine" ] [ "nodes" "machine" ]) + # ]; + + options = { + machine = mkOption { + internal = true; + type = types.raw; + }; + }; + + config = { + nodes = mkIf options.machine.isDefined ( + lib.warn + "In test `${config.name}': The `machine' attribute in NixOS tests (pkgs.nixosTest / make-test-python.nix / testing-python.nix / makeTest) is deprecated. Please set the equivalent `nodes.machine'." + { inherit (config) machine; } + ); + }; +} diff --git a/nixos/lib/testing/meta.nix b/nixos/lib/testing/meta.nix new file mode 100644 index 000000000000..1312d6a986ec --- /dev/null +++ b/nixos/lib/testing/meta.nix @@ -0,0 +1,12 @@ +{ lib, ... }: +let + inherit (lib) types mkOption; +in +{ + options = { + meta.maintainers = lib.mkOption { + type = types.listOf types.raw; + default = []; + }; + }; +} diff --git a/nixos/lib/testing/name.nix b/nixos/lib/testing/name.nix new file mode 100644 index 000000000000..f9fa488511c0 --- /dev/null +++ b/nixos/lib/testing/name.nix @@ -0,0 +1,7 @@ +{ lib, ... }: +{ + options.name = lib.mkOption { + description = "The name of the test."; + type = lib.types.str; + }; +} diff --git a/nixos/lib/testing/network.nix b/nixos/lib/testing/network.nix new file mode 100644 index 000000000000..e0446846fb09 --- /dev/null +++ b/nixos/lib/testing/network.nix @@ -0,0 +1,75 @@ +{ lib, nodes, ... }: + +with lib; + + +let + machines = attrNames nodes; + + machinesNumbered = zipLists machines (range 1 254); + + nodes_ = forEach machinesNumbered (m: nameValuePair m.fst + [ + ({ config, nodes, pkgs, ... }: + let + interfacesNumbered = zipLists config.virtualisation.vlans (range 1 255); + interfaces = forEach interfacesNumbered ({ fst, snd }: + nameValuePair "eth${toString snd}" { + ipv4.addresses = + [{ + address = "192.168.${toString fst}.${toString m.snd}"; + prefixLength = 24; + }]; + }); + + networkConfig = + { + networking.hostName = mkDefault m.fst; + + networking.interfaces = listToAttrs interfaces; + + networking.primaryIPAddress = + optionalString (interfaces != [ ]) (head (head interfaces).value.ipv4.addresses).address; + + # Put the IP addresses of all VMs in this machine's + # /etc/hosts file. If a machine has multiple + # interfaces, use the IP address corresponding to + # the first interface (i.e. the first network in its + # virtualisation.vlans option). + networking.extraHosts = flip concatMapStrings machines + (m': + let config = (getAttr m' nodes).config; in + optionalString (config.networking.primaryIPAddress != "") + ("${config.networking.primaryIPAddress} " + + optionalString (config.networking.domain != null) + "${config.networking.hostName}.${config.networking.domain} " + + "${config.networking.hostName}\n")); + + virtualisation.qemu.options = + let qemu-common = import ../qemu-common.nix { inherit lib pkgs; }; + in + flip concatMap interfacesNumbered + ({ fst, snd }: qemu-common.qemuNICFlags snd fst m.snd); + }; + + in + { + key = "ip-address"; + config = networkConfig // { + # Expose the networkConfig items for tests like nixops + # that need to recreate the network config. + system.build.networkConfig = networkConfig; + }; + } + ) + ]); + + extraNodeConfigs = lib.listToAttrs nodes_; +in +{ + config = { + defaults = { config, name, ... }: { + imports = extraNodeConfigs.${name}; + }; + }; +} diff --git a/nixos/lib/testing/nodes.nix b/nixos/lib/testing/nodes.nix new file mode 100644 index 000000000000..98580d5dc4f8 --- /dev/null +++ b/nixos/lib/testing/nodes.nix @@ -0,0 +1,91 @@ +testModuleArgs@{ config, lib, hostPkgs, nodes, ... }: + +let + inherit (lib) mkOption mkForce optional types mapAttrs mkDefault; + + system = hostPkgs.stdenv.hostPlatform.system; + + baseOS = + import ../eval-config.nix { + inherit system; + inherit (config.node) specialArgs; + modules = [ config.defaults ]; + baseModules = (import ../../modules/module-list.nix) ++ + [ + ../../modules/virtualisation/qemu-vm.nix + ../../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs + { key = "no-manual"; documentation.nixos.enable = false; } + { + key = "no-revision"; + # Make the revision metadata constant, in order to avoid needless retesting. + # The human version (e.g. 21.05-pre) is left as is, because it is useful + # for external modules that test with e.g. testers.nixosTest and rely on that + # version number. + config.system.nixos.revision = mkForce "constant-nixos-revision"; + } + { key = "nodes"; _module.args.nodes = nodes; } + + ({ config, ... }: + { + virtualisation.qemu.package = testModuleArgs.config.qemu.package; + + # Ensure we do not use aliases. Ideally this is only set + # when the test framework is used by Nixpkgs NixOS tests. + nixpkgs.config.allowAliases = false; + }) + ] ++ optional config.minimal ../../modules/testing/minimal-kernel.nix; + }; + + +in + +{ + + options = { + node.type = mkOption { + type = types.raw; + default = baseOS.type; + internal = true; + }; + + nodes = mkOption { + type = types.lazyAttrsOf config.node.type; + }; + + defaults = mkOption { + description = '' + NixOS configuration that is applied to all {option}`nodes`. + ''; + type = types.deferredModule; + default = { }; + }; + + node.specialArgs = mkOption { + type = types.lazyAttrsOf types.raw; + default = { }; + }; + + minimal = mkOption { + type = types.bool; + default = false; + }; + + nodesCompat = mkOption { + internal = true; + }; + }; + + config = { + _module.args.nodes = config.nodesCompat; + nodesCompat = + mapAttrs + (name: config: config // { + config = lib.warn + "Module argument `nodes.${name}.config` is deprecated. Use `nodes.${name}` instead." + config; + }) + config.nodes; + + passthru.nodes = config.nodesCompat; + }; +} diff --git a/nixos/lib/testing/run.nix b/nixos/lib/testing/run.nix new file mode 100644 index 000000000000..65bcbe720bf3 --- /dev/null +++ b/nixos/lib/testing/run.nix @@ -0,0 +1,51 @@ +{ config, hostPkgs, lib, ... }: +let + inherit (lib) types mkOption; +in +{ + options = { + passthru = mkOption { + type = types.lazyAttrsOf types.raw; + description = '' + Attributes to add to the returned derivations, + which are not necessarily part of the build. + + This is a bit like doing `drv // { myAttr = true; }` (which would be lost by `overrideAttrs`). + It does not change the actual derivation, but adds the attribute nonetheless, so that + consumers of what would be `drv` have more information. + ''; + }; + + run = mkOption { + type = types.package; + description = '' + Derivation that runs the test. + ''; + }; + }; + + config = { + run = hostPkgs.stdenv.mkDerivation { + name = "vm-test-run-${config.name}"; + + requiredSystemFeatures = [ "kvm" "nixos-test" ]; + + buildCommand = + '' + mkdir -p $out + + # effectively mute the XMLLogger + export LOGFILE=/dev/null + + ${config.driver}/bin/nixos-test-driver -o $out + ''; + + passthru = config.passthru; + + meta = config.meta; + }; + + # useful for inspection (debugging / exploration) + passthru.config = config; + }; +} diff --git a/nixos/lib/testing/testScript.nix b/nixos/lib/testing/testScript.nix new file mode 100644 index 000000000000..08e87b626b3b --- /dev/null +++ b/nixos/lib/testing/testScript.nix @@ -0,0 +1,78 @@ +testModuleArgs@{ config, lib, hostPkgs, nodes, moduleType, ... }: +let + inherit (lib) mkOption types; + inherit (types) either str functionTo; +in +{ + options = { + testScript = mkOption { + type = either str (functionTo str); + }; + testScriptString = mkOption { + type = str; + readOnly = true; + internal = true; + }; + + includeTestScriptReferences = mkOption { + type = types.bool; + default = true; + internal = true; + }; + withoutTestScriptReferences = mkOption { + type = moduleType; + description = '' + A parallel universe where the testScript is invalid and has no references. + ''; + }; + }; + config = { + withoutTestScriptReferences.includeTestScriptReferences = false; + withoutTestScriptReferences.testScript = lib.mkForce "testscript omitted"; + + testScriptString = + if lib.isFunction config.testScript + then + config.testScript + { + nodes = + lib.mapAttrs + (k: v: + if v.virtualisation.useNixStoreImage + then + # prevent infinite recursion when testScript would + # reference v's toplevel + config.withoutTestScriptReferences.nodesCompat.${k} + else + # reuse memoized config + v + ) + config.nodesCompat; + } + else config.testScript; + + defaults = { config, name, ... }: { + # Make sure all derivations referenced by the test + # script are available on the nodes. When the store is + # accessed through 9p, this isn't important, since + # everything in the store is available to the guest, + # but when building a root image it is, as all paths + # that should be available to the guest has to be + # copied to the image. + virtualisation.additionalPaths = + lib.optional + # A testScript may evaluate nodes, which has caused + # infinite recursions. The demand cycle involves: + # testScript --> + # nodes --> + # toplevel --> + # additionalPaths --> + # hasContext testScript' --> + # testScript (ad infinitum) + # If we don't need to build an image, we can break this + # cycle by short-circuiting when useNixStoreImage is false. + (config.virtualisation.useNixStoreImage && builtins.hasContext testModuleArgs.config.testScriptString && testModuleArgs.config.includeTestScriptReferences) + (hostPkgs.writeStringReferencesToFile testModuleArgs.config.testScriptString); + }; + }; +} From 3c09cb23639c185f3b168b56bfc83ab3768dd1e0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 6 Jun 2022 20:19:59 +0200 Subject: [PATCH 004/113] nixos/all-tests.nix: Improve runTest for release.nix ... and add runTestOn. --- nixos/tests/all-tests.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index e0121fe6b6b8..eb13e33bd9aa 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -27,6 +27,22 @@ let }; evalMinimalConfig = module: nixosLib.evalModules { modules = [ module ]; }; + inherit + (rec { + doRunTest = (import ../lib/testing-python.nix { inherit system pkgs; }).runTest; + findTests = tree: + if tree?recurseForDerivations && tree.recurseForDerivations + then mapAttrs (k: findTests) (builtins.removeAttrs tree ["recurseForDerivations"]) + else callTest ({ test = tree; }); + runTest = arg: let r = doRunTest arg; in findTests r; + runTestOn = systems: arg: + if elem system systems then runTest arg + else {}; + }) + runTest + runTestOn + ; + in { _3proxy = handleTest ./3proxy.nix {}; acme = handleTest ./acme.nix {}; From 124b0c4abcd4ee093c7cee95f36f576bc6abffa5 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 6 Jun 2022 20:30:17 +0200 Subject: [PATCH 005/113] nixos/testing/network.nix: Avoid deprecated .config --- nixos/lib/testing/network.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/lib/testing/network.nix b/nixos/lib/testing/network.nix index e0446846fb09..dfdd9b8314a2 100644 --- a/nixos/lib/testing/network.nix +++ b/nixos/lib/testing/network.nix @@ -38,7 +38,7 @@ let # virtualisation.vlans option). networking.extraHosts = flip concatMapStrings machines (m': - let config = (getAttr m' nodes).config; in + let config = getAttr m' nodes; in optionalString (config.networking.primaryIPAddress != "") ("${config.networking.primaryIPAddress} " + optionalString (config.networking.domain != null) From a958a4aa009e371d38936ef86a327cb9e6fb154a Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 6 Jun 2022 21:19:22 +0200 Subject: [PATCH 006/113] nixos/testing: Add pkgs parameter This parameter is for packages to use in VMs, unlike hostPkgs. --- nixos/lib/testing-python.nix | 1 + nixos/lib/testing/pkgs.nix | 11 +++++++++++ nixos/tests/3proxy.nix | 4 ++-- nixos/tests/all-tests.nix | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 nixos/lib/testing/pkgs.nix diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index ab509c098d24..1c331a3c5162 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -177,6 +177,7 @@ rec { ./testing/name.nix ./testing/network.nix ./testing/nodes.nix + ./testing/pkgs.nix ./testing/run.nix ./testing/testScript.nix { diff --git a/nixos/lib/testing/pkgs.nix b/nixos/lib/testing/pkgs.nix new file mode 100644 index 000000000000..22dd586868e3 --- /dev/null +++ b/nixos/lib/testing/pkgs.nix @@ -0,0 +1,11 @@ +{ config, lib, hostPkgs, ... }: +{ + config = { + # default pkgs for use in VMs + _module.args.pkgs = hostPkgs; + + defaults = { + # TODO: a module to set a shared pkgs, if options.nixpkgs.* is untouched by user (highestPrio) */ + }; + }; +} diff --git a/nixos/tests/3proxy.nix b/nixos/tests/3proxy.nix index 8127438fabd9..d367295e538b 100644 --- a/nixos/tests/3proxy.nix +++ b/nixos/tests/3proxy.nix @@ -1,4 +1,4 @@ -import ./make-test-python.nix ({ pkgs, ...} : { +{ lib, pkgs, ... }: { name = "3proxy"; meta = with pkgs.lib.maintainers; { maintainers = [ misuzu ]; @@ -186,4 +186,4 @@ import ./make-test-python.nix ({ pkgs, ...} : { "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.4:3128 -S -O /dev/null http://127.0.0.1:9999" ) ''; -}) +} diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index eb13e33bd9aa..b4f77557a40b 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -44,7 +44,7 @@ let ; in { - _3proxy = handleTest ./3proxy.nix {}; + _3proxy = runTest ./3proxy.nix; acme = handleTest ./acme.nix {}; adguardhome = handleTest ./adguardhome.nix {}; aesmd = handleTest ./aesmd.nix {}; From 0691b450b1d1c5e2846e23fd145e7c08d242c0e1 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 6 Jun 2022 21:05:41 +0200 Subject: [PATCH 007/113] nixosTests._3proxy: Use module system based runner --- nixos/tests/3proxy.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/tests/3proxy.nix b/nixos/tests/3proxy.nix index d367295e538b..647d9d57c7ff 100644 --- a/nixos/tests/3proxy.nix +++ b/nixos/tests/3proxy.nix @@ -1,6 +1,6 @@ { lib, pkgs, ... }: { name = "3proxy"; - meta = with pkgs.lib.maintainers; { + meta = with lib.maintainers; { maintainers = [ misuzu ]; }; @@ -92,7 +92,7 @@ networking.firewall.allowedTCPPorts = [ 3128 9999 ]; }; - peer3 = { lib, ... }: { + peer3 = { lib, pkgs, ... }: { networking.useDHCP = false; networking.interfaces.eth1 = { ipv4.addresses = [ From 9e4277b970d96ddc1c2bbe4686757ae761baa18a Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 6 Jun 2022 23:46:39 +0200 Subject: [PATCH 008/113] nixos/testing/network.nix: Fix for specialisations and specialArgs.name Before this, it relied on being able to `imports` from the `name` module argument, which wasn't really necessary and required a potentially quite breaking change. We can revert that now. --- nixos/lib/testing/network.nix | 159 +++++++++++++++++++++------------- 1 file changed, 98 insertions(+), 61 deletions(-) diff --git a/nixos/lib/testing/network.nix b/nixos/lib/testing/network.nix index dfdd9b8314a2..c87abee30c93 100644 --- a/nixos/lib/testing/network.nix +++ b/nixos/lib/testing/network.nix @@ -1,75 +1,112 @@ { lib, nodes, ... }: -with lib; - - let - machines = attrNames nodes; + inherit (lib) + attrNames concatMap concatMapStrings flip forEach head + listToAttrs mkDefault mkOption nameValuePair optionalString + range types zipListsWith zipLists + ; - machinesNumbered = zipLists machines (range 1 254); + nodeNumbers = + listToAttrs + (zipListsWith + nameValuePair + (attrNames nodes) + (range 1 254) + ); - nodes_ = forEach machinesNumbered (m: nameValuePair m.fst - [ - ({ config, nodes, pkgs, ... }: - let - interfacesNumbered = zipLists config.virtualisation.vlans (range 1 255); - interfaces = forEach interfacesNumbered ({ fst, snd }: - nameValuePair "eth${toString snd}" { - ipv4.addresses = - [{ - address = "192.168.${toString fst}.${toString m.snd}"; - prefixLength = 24; - }]; - }); + networkModule = { config, nodes, pkgs, ... }: + let + interfacesNumbered = zipLists config.virtualisation.vlans (range 1 255); + interfaces = forEach interfacesNumbered ({ fst, snd }: + nameValuePair "eth${toString snd}" { + ipv4.addresses = + [{ + address = "192.168.${toString fst}.${toString config.virtualisation.test.nodeNumber}"; + prefixLength = 24; + }]; + }); - networkConfig = - { - networking.hostName = mkDefault m.fst; - - networking.interfaces = listToAttrs interfaces; - - networking.primaryIPAddress = - optionalString (interfaces != [ ]) (head (head interfaces).value.ipv4.addresses).address; - - # Put the IP addresses of all VMs in this machine's - # /etc/hosts file. If a machine has multiple - # interfaces, use the IP address corresponding to - # the first interface (i.e. the first network in its - # virtualisation.vlans option). - networking.extraHosts = flip concatMapStrings machines - (m': - let config = getAttr m' nodes; in - optionalString (config.networking.primaryIPAddress != "") - ("${config.networking.primaryIPAddress} " + - optionalString (config.networking.domain != null) - "${config.networking.hostName}.${config.networking.domain} " + - "${config.networking.hostName}\n")); - - virtualisation.qemu.options = - let qemu-common = import ../qemu-common.nix { inherit lib pkgs; }; - in - flip concatMap interfacesNumbered - ({ fst, snd }: qemu-common.qemuNICFlags snd fst m.snd); - }; - - in + networkConfig = { - key = "ip-address"; - config = networkConfig // { - # Expose the networkConfig items for tests like nixops - # that need to recreate the network config. - system.build.networkConfig = networkConfig; + networking.hostName = mkDefault config.virtualisation.test.nodeName; + + networking.interfaces = listToAttrs interfaces; + + networking.primaryIPAddress = + optionalString (interfaces != [ ]) (head (head interfaces).value.ipv4.addresses).address; + + # Put the IP addresses of all VMs in this machine's + # /etc/hosts file. If a machine has multiple + # interfaces, use the IP address corresponding to + # the first interface (i.e. the first network in its + # virtualisation.vlans option). + networking.extraHosts = flip concatMapStrings (attrNames nodes) + (m': + let config = nodes.${m'}; in + optionalString (config.networking.primaryIPAddress != "") + ("${config.networking.primaryIPAddress} " + + optionalString (config.networking.domain != null) + "${config.networking.hostName}.${config.networking.domain} " + + "${config.networking.hostName}\n")); + + virtualisation.qemu.options = + let qemu-common = import ../qemu-common.nix { inherit lib pkgs; }; + in + flip concatMap interfacesNumbered + ({ fst, snd }: qemu-common.qemuNICFlags snd fst config.virtualisation.test.nodeNumber); + }; + + in + { + key = "ip-address"; + config = networkConfig // { + # Expose the networkConfig items for tests like nixops + # that need to recreate the network config. + system.build.networkConfig = networkConfig; + }; + }; + + nodeNumberModule = (regular@{ config, name, ... }: { + options = { + virtualisation.test.nodeName = mkOption { + internal = true; + default = name; + # We need to force this in specilisations, otherwise it'd be + # readOnly = true; + description = '' + The `name` in `nodes.`; stable across `specialisations`. + ''; + }; + virtualisation.test.nodeNumber = mkOption { + internal = true; + type = types.int; + readOnly = true; + default = nodeNumbers.${config.virtualisation.test.nodeName}; + description = '' + A unique number assigned for each node in `nodes`. + ''; + }; + + # specialisations override the `name` module argument, + # so we push the real `virtualisation.test.nodeName`. + specialisation = mkOption { + type = types.attrsOf (types.submodule { + options.configuration = mkOption { + type = types.submodule ({ + config.virtualisation.test.nodeName = + # assert regular.config.virtualisation.test.nodeName != "configuration"; + regular.config.virtualisation.test.nodeName; + }); }; - } - ) - ]); + }); + }; + }; + }); - extraNodeConfigs = lib.listToAttrs nodes_; in { config = { - defaults = { config, name, ... }: { - imports = extraNodeConfigs.${name}; - }; + defaults = { imports = [ networkModule nodeNumberModule ]; }; }; } From b7ffe4446903a014ad37b26b6a206217c27da7fd Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 6 Jun 2022 23:49:59 +0200 Subject: [PATCH 009/113] nixosTests.acme: Use module system based runner --- nixos/tests/acme.nix | 14 +++++++------- nixos/tests/all-tests.nix | 2 +- nixos/tests/common/acme/client/default.nix | 4 ++-- nixos/tests/common/acme/server/default.nix | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/nixos/tests/acme.nix b/nixos/tests/acme.nix index c07f99c5db3a..d3a436080ebf 100644 --- a/nixos/tests/acme.nix +++ b/nixos/tests/acme.nix @@ -1,7 +1,7 @@ -import ./make-test-python.nix ({ pkgs, lib, ... }: let +{ pkgs, lib, ... }: let commonConfig = ./common/acme/client; - dnsServerIP = nodes: nodes.dnsserver.config.networking.primaryIPAddress; + dnsServerIP = nodes: nodes.dnsserver.networking.primaryIPAddress; dnsScript = nodes: let dnsAddress = dnsServerIP nodes; @@ -153,7 +153,7 @@ in { description = "Pebble ACME challenge test server"; wantedBy = [ "network.target" ]; serviceConfig = { - ExecStart = "${pkgs.pebble}/bin/pebble-challtestsrv -dns01 ':53' -defaultIPv6 '' -defaultIPv4 '${nodes.webserver.config.networking.primaryIPAddress}'"; + ExecStart = "${pkgs.pebble}/bin/pebble-challtestsrv -dns01 ':53' -defaultIPv6 '' -defaultIPv4 '${nodes.webserver.networking.primaryIPAddress}'"; # Required to bind on privileged ports. AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; }; @@ -175,7 +175,7 @@ in { specialisation = { # First derivation used to test general ACME features general.configuration = { ... }: let - caDomain = nodes.acme.config.test-support.acme.caDomain; + caDomain = nodes.acme.test-support.acme.caDomain; email = config.security.acme.defaults.email; # Exit 99 to make it easier to track if this is the reason a renew failed accountCreateTester = '' @@ -316,7 +316,7 @@ in { testScript = { nodes, ... }: let - caDomain = nodes.acme.config.test-support.acme.caDomain; + caDomain = nodes.acme.test-support.acme.caDomain; newServerSystem = nodes.webserver.config.system.build.toplevel; switchToNewServer = "${newServerSystem}/bin/switch-to-configuration test"; in @@ -438,7 +438,7 @@ in { client.wait_for_unit("default.target") client.succeed( - 'curl --data \'{"host": "${caDomain}", "addresses": ["${nodes.acme.config.networking.primaryIPAddress}"]}\' http://${dnsServerIP nodes}:8055/add-a' + 'curl --data \'{"host": "${caDomain}", "addresses": ["${nodes.acme.networking.primaryIPAddress}"]}\' http://${dnsServerIP nodes}:8055/add-a' ) acme.wait_for_unit("network-online.target") @@ -594,4 +594,4 @@ in { wait_for_server() check_connection_key_bits(client, test_domain, "384") ''; -}) +} diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index b4f77557a40b..463bab49e1bb 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -45,7 +45,7 @@ let in { _3proxy = runTest ./3proxy.nix; - acme = handleTest ./acme.nix {}; + acme = runTest ./acme.nix; adguardhome = handleTest ./adguardhome.nix {}; aesmd = handleTest ./aesmd.nix {}; agate = handleTest ./web-servers/agate.nix {}; diff --git a/nixos/tests/common/acme/client/default.nix b/nixos/tests/common/acme/client/default.nix index 9dbe345e7a01..503e610d1ac9 100644 --- a/nixos/tests/common/acme/client/default.nix +++ b/nixos/tests/common/acme/client/default.nix @@ -1,7 +1,7 @@ { lib, nodes, pkgs, ... }: let - caCert = nodes.acme.config.test-support.acme.caCert; - caDomain = nodes.acme.config.test-support.acme.caDomain; + caCert = nodes.acme.test-support.acme.caCert; + caDomain = nodes.acme.test-support.acme.caDomain; in { security.acme = { diff --git a/nixos/tests/common/acme/server/default.nix b/nixos/tests/common/acme/server/default.nix index fa1b9b545d09..b81f860125c8 100644 --- a/nixos/tests/common/acme/server/default.nix +++ b/nixos/tests/common/acme/server/default.nix @@ -18,10 +18,10 @@ # # example = { nodes, ... }: { # networking.nameservers = [ -# nodes.acme.config.networking.primaryIPAddress +# nodes.acme.networking.primaryIPAddress # ]; # security.pki.certificateFiles = [ -# nodes.acme.config.test-support.acme.caCert +# nodes.acme.test-support.acme.caCert # ]; # }; # } @@ -36,7 +36,7 @@ # acme = { nodes, lib, ... }: { # imports = [ ./common/acme/server ]; # networking.nameservers = lib.mkForce [ -# nodes.myresolver.config.networking.primaryIPAddress +# nodes.myresolver.networking.primaryIPAddress # ]; # }; # From edf8be37af44fa214811c9165c4f45eef0fadd1c Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 9 Jun 2022 17:43:22 +0200 Subject: [PATCH 010/113] nixosTests.adguardhome: Use module based runner --- nixos/tests/adguardhome.nix | 2 +- nixos/tests/all-tests.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/tests/adguardhome.nix b/nixos/tests/adguardhome.nix index ddbe8ff9c117..1a220f996998 100644 --- a/nixos/tests/adguardhome.nix +++ b/nixos/tests/adguardhome.nix @@ -1,4 +1,4 @@ -import ./make-test-python.nix { +{ name = "adguardhome"; nodes = { diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 463bab49e1bb..229886370cb1 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -46,7 +46,7 @@ let in { _3proxy = runTest ./3proxy.nix; acme = runTest ./acme.nix; - adguardhome = handleTest ./adguardhome.nix {}; + adguardhome = runTest ./adguardhome.nix; aesmd = handleTest ./aesmd.nix {}; agate = handleTest ./web-servers/agate.nix {}; agda = handleTest ./agda.nix {}; From 15dcbc2514f019276f9cd73c804deab76fa1031f Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 9 Jun 2022 17:45:02 +0200 Subject: [PATCH 011/113] nixosTests.aesmd: Use module based runner --- nixos/tests/aesmd.nix | 4 ++-- nixos/tests/all-tests.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/tests/aesmd.nix b/nixos/tests/aesmd.nix index 9f07426be8d8..5da661afd548 100644 --- a/nixos/tests/aesmd.nix +++ b/nixos/tests/aesmd.nix @@ -1,4 +1,4 @@ -import ./make-test-python.nix ({ pkgs, lib, ... }: { +{ pkgs, lib, ... }: { name = "aesmd"; meta = { maintainers = with lib.maintainers; [ veehaitch ]; @@ -59,4 +59,4 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { assert aesmd_config == "whitelist url = http://nixos.org\nproxy type = direct\ndefault quoting type = ecdsa_256\n", "aesmd.conf differs" ''; -}) +} diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 229886370cb1..877efb001895 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -47,7 +47,7 @@ in { _3proxy = runTest ./3proxy.nix; acme = runTest ./acme.nix; adguardhome = runTest ./adguardhome.nix; - aesmd = handleTest ./aesmd.nix {}; + aesmd = runTest ./aesmd.nix; agate = handleTest ./web-servers/agate.nix {}; agda = handleTest ./agda.nix {}; airsonic = handleTest ./airsonic.nix {}; From 5727fd3e6f17684eb8bace334564cda302077524 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 9 Jun 2022 17:46:51 +0200 Subject: [PATCH 012/113] nixosTests.agate: Use module based runner --- nixos/tests/all-tests.nix | 2 +- nixos/tests/web-servers/agate.nix | 46 +++++++++++++++---------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 877efb001895..5cd58cb5c3fd 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -48,7 +48,7 @@ in { acme = runTest ./acme.nix; adguardhome = runTest ./adguardhome.nix; aesmd = runTest ./aesmd.nix; - agate = handleTest ./web-servers/agate.nix {}; + agate = runTest ./web-servers/agate.nix; agda = handleTest ./agda.nix {}; airsonic = handleTest ./airsonic.nix {}; allTerminfo = handleTest ./all-terminfo.nix {}; diff --git a/nixos/tests/web-servers/agate.nix b/nixos/tests/web-servers/agate.nix index e364e134cfda..e8d789a9ca44 100644 --- a/nixos/tests/web-servers/agate.nix +++ b/nixos/tests/web-servers/agate.nix @@ -1,29 +1,27 @@ -import ../make-test-python.nix ( - { pkgs, lib, ... }: - { - name = "agate"; - meta = with lib.maintainers; { maintainers = [ jk ]; }; +{ pkgs, lib, ... }: +{ + name = "agate"; + meta = with lib.maintainers; { maintainers = [ jk ]; }; - nodes = { - geminiserver = { pkgs, ... }: { - services.agate = { - enable = true; - hostnames = [ "localhost" ]; - contentDir = pkgs.writeTextDir "index.gmi" '' - # Hello NixOS! - ''; - }; + nodes = { + geminiserver = { pkgs, ... }: { + services.agate = { + enable = true; + hostnames = [ "localhost" ]; + contentDir = pkgs.writeTextDir "index.gmi" '' + # Hello NixOS! + ''; }; }; + }; - testScript = { nodes, ... }: '' - geminiserver.wait_for_unit("agate") - geminiserver.wait_for_open_port(1965) + testScript = { nodes, ... }: '' + geminiserver.wait_for_unit("agate") + geminiserver.wait_for_open_port(1965) - with subtest("check is serving over gemini"): - response = geminiserver.succeed("${pkgs.gmni}/bin/gmni -j once -i -N gemini://localhost:1965") - print(response) - assert "Hello NixOS!" in response - ''; - } -) + with subtest("check is serving over gemini"): + response = geminiserver.succeed("${pkgs.gmni}/bin/gmni -j once -i -N gemini://localhost:1965") + print(response) + assert "Hello NixOS!" in response + ''; +} From 5603d7f832342a635afed0cabcb1fe0343fa00cb Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 21 Sep 2022 16:45:56 +0200 Subject: [PATCH 013/113] python3Packages.tesserocr: enable tests, cleanup --- .../python-modules/tesserocr/default.nix | 51 ++++++++++++++----- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/tesserocr/default.nix b/pkgs/development/python-modules/tesserocr/default.nix index 0b21e17f96b0..c8e1d2e64f95 100644 --- a/pkgs/development/python-modules/tesserocr/default.nix +++ b/pkgs/development/python-modules/tesserocr/default.nix @@ -1,14 +1,18 @@ -{ - buildPythonPackage, - fetchPypi, - lib, - # build dependencies - cython, - leptonica, - pkg-config, - tesseract, - # extra python packages - pillow +{ buildPythonPackage +, fetchPypi +, lib + +# build dependencies +, cython +, leptonica +, pkg-config +, tesseract + +# propagates +, pillow + +# tests +, unittestCheckHook }: buildPythonPackage rec { @@ -20,11 +24,30 @@ buildPythonPackage rec { sha256 = "1bmj76gi8401lcqdaaznfmz9yf11myy1bzivqwwq08z3dwzxswck"; }; - nativeBuildInputs = [ cython pkg-config ]; - buildInputs = [ leptonica tesseract ]; - propagatedBuildInputs = [ pillow ]; + nativeBuildInputs = [ + cython + pkg-config + ]; + + buildInputs = [ + leptonica + tesseract + ]; + + propagatedBuildInputs = [ + pillow + ]; + + pythonImportsCheck = [ + "tesserocr" + ]; + + checkInputs = [ + unittestCheckHook + ]; meta = with lib; { + changelog = "https://github.com/sirfz/tesserocr/releases/tag/v${version}"; description = "A simple, Pillow-friendly, wrapper around the tesseract-ocr API for Optical Character Recognition (OCR)"; homepage = "https://github.com/sirfz/tesserocr"; license = licenses.mit; From 2864ef44e391283ccedd0865778725d06cf94397 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 21 Sep 2022 17:41:32 +0200 Subject: [PATCH 014/113] unpaper: 6.1 -> 7.0.0 Migrates the build to meson and ninja and adds support for ffmpeg 5. The package now creates a man page that we divert into a dedicated man output. Adds the paperless test into passthru.tests for good measure. --- pkgs/tools/graphics/unpaper/default.nix | 46 ++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/graphics/unpaper/default.nix b/pkgs/tools/graphics/unpaper/default.nix index 9b8542a86bba..72c63d6cfd2c 100644 --- a/pkgs/tools/graphics/unpaper/default.nix +++ b/pkgs/tools/graphics/unpaper/default.nix @@ -1,16 +1,52 @@ -{ lib, stdenv, fetchurl, buildPackages, pkg-config, ffmpeg_4 }: +{ lib +, stdenv +, fetchurl + +# build +, meson +, ninja +, pkg-config + +# docs +, sphinx + +# runtime +, buildPackages +, ffmpeg_5 + +# tests +, nixosTests +}: stdenv.mkDerivation rec { pname = "unpaper"; - version = "6.1"; + version = "7.0.0"; src = fetchurl { url = "https://www.flameeyes.eu/files/${pname}-${version}.tar.xz"; - sha256 = "0c5rbkxbmy9k8vxjh4cv0bgnqd3wqc99yzw215vkyjslvbsq8z13"; + hash = "sha256-JXX7vybCJxnRy4grWWAsmQDH90cRisEwiD9jQZvkaoA="; }; - nativeBuildInputs = [ pkg-config buildPackages.libxslt.bin ]; - buildInputs = [ ffmpeg_4 ]; + outputs = [ + "out" + "man" + ]; + + nativeBuildInputs = [ + buildPackages.libxslt.bin + meson + ninja + pkg-config + sphinx + ]; + + buildInputs = [ + ffmpeg_5 + ]; + + passthru.tests = { + inherit (nixosTests) paperless; + }; meta = with lib; { homepage = "https://www.flameeyes.eu/projects/unpaper"; From 5b1a4ed0bff8d2facae2a20e5e0f7e89ffbf90bd Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 21 Sep 2022 15:34:42 +0200 Subject: [PATCH 015/113] paperless-ngx: Upgrade to tesseract5 The documentation of paperless-ngx mentions it supports versions greater than or equal 4.0. --- pkgs/applications/office/paperless-ngx/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix index e85f13b892f7..279a4198f947 100644 --- a/pkgs/applications/office/paperless-ngx/default.nix +++ b/pkgs/applications/office/paperless-ngx/default.nix @@ -8,7 +8,7 @@ , optipng , pngquant , qpdf -, tesseract4 +, tesseract5 , unpaper , liberation_ttf , fetchFromGitHub @@ -56,7 +56,7 @@ let optipng pngquant qpdf - tesseract4 + tesseract5 unpaper ]; in From d61d1ec883fac68c35c92ea14946edd4b3c47dab Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 21 Sep 2022 16:34:47 +0200 Subject: [PATCH 016/113] python3Packages.ocrmypdf: Upgrade to tesseract5 --- pkgs/development/python-modules/ocrmypdf/default.nix | 4 ++-- pkgs/top-level/python-packages.nix | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/ocrmypdf/default.nix b/pkgs/development/python-modules/ocrmypdf/default.nix index 0acaf7842069..77dee64bb45f 100644 --- a/pkgs/development/python-modules/ocrmypdf/default.nix +++ b/pkgs/development/python-modules/ocrmypdf/default.nix @@ -19,7 +19,7 @@ , setuptools-scm , setuptools-scm-git-archive , substituteAll -, tesseract4 +, tesseract , tqdm , unpaper , installShellFiles @@ -50,7 +50,7 @@ buildPythonPackage rec { gs = "${lib.getBin ghostscript}/bin/gs"; jbig2 = "${lib.getBin jbig2enc}/bin/jbig2"; pngquant = "${lib.getBin pngquant}/bin/pngquant"; - tesseract = "${lib.getBin tesseract4}/bin/tesseract"; + tesseract = "${lib.getBin tesseract}/bin/tesseract"; unpaper = "${lib.getBin unpaper}/bin/unpaper"; }) ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eb4600bcaaec..9c31f185e238 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6328,7 +6328,9 @@ in { ocifs = callPackage ../development/python-modules/ocifs { }; - ocrmypdf = callPackage ../development/python-modules/ocrmypdf { }; + ocrmypdf = callPackage ../development/python-modules/ocrmypdf { + tesseract = pkgs.tesseract5; + }; od = callPackage ../development/python-modules/od { }; From b0c781cc4136e4678db1864875750c916b78ad33 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 15 Jun 2022 16:59:21 +0200 Subject: [PATCH 017/113] nixos/testing: Move entrypoint to nixos/lib + doc --- .../writing-nixos-tests.section.md | 73 +++++- .../writing-nixos-tests.section.xml | 217 ++++++++++++------ nixos/lib/default.nix | 8 + nixos/lib/testing-python.nix | 31 +-- nixos/lib/testing/default.nix | 24 ++ 5 files changed, 256 insertions(+), 97 deletions(-) create mode 100644 nixos/lib/testing/default.nix diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md index 6934bb0face7..8dd3e6fb7597 100644 --- a/nixos/doc/manual/development/writing-nixos-tests.section.md +++ b/nixos/doc/manual/development/writing-nixos-tests.section.md @@ -1,9 +1,9 @@ # Writing Tests {#sec-writing-nixos-tests} -A NixOS test is a Nix expression that has the following structure: +A NixOS test is a module that has the following structure: ```nix -import ./make-test-python.nix { +{ # One or more machines: nodes = @@ -21,7 +21,10 @@ import ./make-test-python.nix { } ``` -The attribute `testScript` is a bit of Python code that executes the +We refer to the whole test above as a test module, whereas the values +in `nodes.` are NixOS modules. (A NixOS configuration is a module.) + +The option `testScript` is a bit of Python code that executes the test (described below). During the test, it will start one or more virtual machines, the configuration of which is described by the attribute `nodes`. @@ -34,7 +37,64 @@ when switching between consoles, and so on. An interesting multi-node test is [`nfs/simple.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs/simple.nix). It uses two client nodes to test correct locking across server crashes. -There are a few special NixOS configuration options for test VMs: +## Calling a test {#sec-calling-nixos-tests} + +Tests are invoked a bit differently depending on whether the test lives in NixOS or in another project. + +### Testing within NixOS {#sec-call-nixos-test-in-nixos} + +Test modules can be instantiated into derivations in multiple ways. + +Tests that are part of NixOS are added to [`nixos/tests/all-tests.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/all-tests.nix). + +```nix + hostname = runTest ./hostname.nix; +``` + +Overrides can be added by defining an anonymous module in `all-tests.nix`. +For the purpose of constructing a test matrix, use the `matrix` options instead. + +```nix + hostname = runTest { imports = [ ./hostname.nix ]; defaults.networking.firewall.enable = false; }; +``` + +You can run a test with attribute name `mytest` in `all-tests.nix` by invoking: + +```shell +nix-build -A nixosTests.mytest +``` + +### Testing outside the NixOS project {#sec-call-nixos-test-outside-nixos} + +Outside the `nixpkgs` repository, you can instantiate the test by first acquiring the NixOS library, + +```nix +# regular nix +let nixos-lib = import (nixpkgs + "/nixos/lib") { }; +in +``` + +```nix +# flake +let nixos-lib = nixpkgs.lib.nixos; +in +``` + +... and then invoking `runTest`, for example: + +```nix +nixos-lib.runTest { + imports = [ ./test.nix ]; + hostPkgs = pkgs; # the Nixpkgs package set used outside the VMs + defaults.services.foo.package = mypkg; +} +``` + +`runTest` returns a derivation that runs the test. + +## Configuring the nodes {#sec-nixos-test-nodes} + +There are a few special NixOS options for test VMs: `virtualisation.memorySize` @@ -304,7 +364,7 @@ For faster dev cycles it\'s also possible to disable the code-linters (this shouldn\'t be commited though): ```nix -import ./make-test-python.nix { +{ skipLint = true; nodes.machine = { config, pkgs, ... }: @@ -336,7 +396,7 @@ Similarly, the type checking of test scripts can be disabled in the following way: ```nix -import ./make-test-python.nix { +{ skipTypeCheck = true; nodes.machine = { config, pkgs, ... }: @@ -400,7 +460,6 @@ added using the parameter `extraPythonPackages`. For example, you could add `numpy` like this: ```nix -import ./make-test-python.nix { extraPythonPackages = p: [ p.numpy ]; diff --git a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml index d6f4f61c0645..6d0465e4230b 100644 --- a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml +++ b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml @@ -1,10 +1,10 @@
Writing Tests - A NixOS test is a Nix expression that has the following structure: + A NixOS test is a module that has the following structure: -import ./make-test-python.nix { +{ # One or more machines: nodes = @@ -22,7 +22,12 @@ import ./make-test-python.nix { } - The attribute testScript is a bit of Python code + We refer to the whole test above as a test module, whereas the + values in nodes.<name> are NixOS modules. + (A NixOS configuration is a module.) + + + The option testScript is a bit of Python code that executes the test (described below). During the test, it will start one or more virtual machines, the configuration of which is described by the attribute nodes. @@ -38,78 +43,149 @@ import ./make-test-python.nix { It uses two client nodes to test correct locking across server crashes. - - There are a few special NixOS configuration options for test VMs: - - - - - virtualisation.memorySize - - - - The memory of the VM in megabytes. - - - - - - virtualisation.vlans - - - - The virtual networks to which the VM is connected. See - nat.nix - for an example. - - - - - - virtualisation.writableStore - - - - By default, the Nix store in the VM is not writable. If you - enable this option, a writable union file system is mounted on - top of the Nix store to make it appear writable. This is - necessary for tests that run Nix operations that modify the - store. - - - - - - For more options, see the module - qemu-vm.nix. - - - The test script is a sequence of Python statements that perform - various actions, such as starting VMs, executing commands in the - VMs, and so on. Each virtual machine is represented as an object - stored in the variable name if this is also the - identifier of the machine in the declarative config. If you - specified a node nodes.machine, the following - example starts the machine, waits until it has finished booting, - then executes a command and checks that the output is more-or-less - correct: - - +
+ Calling a test + + Tests are invoked a bit differently depending on whether the test + lives in NixOS or in another project. + +
+ Testing within NixOS + + Test modules can be instantiated into derivations in multiple + ways. + + + Tests that are part of NixOS are added to + nixos/tests/all-tests.nix. + + + hostname = runTest ./hostname.nix; + + + Overrides can be added by defining an anonymous module in + all-tests.nix. For the purpose of + constructing a test matrix, use the matrix + options instead. + + + hostname = runTest { imports = [ ./hostname.nix ]; defaults.networking.firewall.enable = false; }; + + + You can run a test with attribute name mytest + in all-tests.nix by invoking: + + +nix-build -A nixosTests.mytest + +
+
+ Testing outside the NixOS project + + Outside the nixpkgs repository, you can + instantiate the test by first acquiring the NixOS library, + + +# regular nix +let nixos-lib = import (nixpkgs + "/nixos/lib") { }; +in + + +# flake +let nixos-lib = nixpkgs.lib.nixos; +in + + + … and then invoking runTest, for example: + + +nixos-lib.runTest { + imports = [ ./test.nix ]; + hostPkgs = pkgs; # the Nixpkgs package set used outside the VMs + defaults.services.foo.package = mypkg; +} + + + runTest returns a derivation that runs the + test. + +
+
+
+ Configuring the nodes + + There are a few special NixOS options for test VMs: + + + + + virtualisation.memorySize + + + + The memory of the VM in megabytes. + + + + + + virtualisation.vlans + + + + The virtual networks to which the VM is connected. See + nat.nix + for an example. + + + + + + virtualisation.writableStore + + + + By default, the Nix store in the VM is not writable. If you + enable this option, a writable union file system is mounted + on top of the Nix store to make it appear writable. This is + necessary for tests that run Nix operations that modify the + store. + + + + + + For more options, see the module + qemu-vm.nix. + + + The test script is a sequence of Python statements that perform + various actions, such as starting VMs, executing commands in the + VMs, and so on. Each virtual machine is represented as an object + stored in the variable name if this is also the + identifier of the machine in the declarative config. If you + specified a node nodes.machine, the following + example starts the machine, waits until it has finished booting, + then executes a command and checks that the output is more-or-less + correct: + + machine.start() machine.wait_for_unit("default.target") if not "Linux" in machine.succeed("uname"): raise Exception("Wrong OS") - - The first line is technically unnecessary; machines are implicitly - started when you first execute an action on them (such as - wait_for_unit or succeed). If - you have multiple machines, you can speed up the test by starting - them in parallel: - - + + The first line is technically unnecessary; machines are implicitly + started when you first execute an action on them (such as + wait_for_unit or succeed). + If you have multiple machines, you can speed up the test by + starting them in parallel: + + start_all() +
Machine objects @@ -563,7 +639,7 @@ machine.wait_for_unit("xautolock.service", "x-session-user") code-linters (this shouldn't be commited though): -import ./make-test-python.nix { +{ skipLint = true; nodes.machine = { config, pkgs, ... }: @@ -595,7 +671,7 @@ import ./make-test-python.nix { the following way: -import ./make-test-python.nix { +{ skipTypeCheck = true; nodes.machine = { config, pkgs, ... }: @@ -669,7 +745,6 @@ def foo_running(): numpy like this: -import ./make-test-python.nix { extraPythonPackages = p: [ p.numpy ]; diff --git a/nixos/lib/default.nix b/nixos/lib/default.nix index 2b3056e01457..65d91342d4d1 100644 --- a/nixos/lib/default.nix +++ b/nixos/lib/default.nix @@ -21,6 +21,8 @@ let seqAttrsIf = cond: a: lib.mapAttrs (_: v: seqIf cond a v); eval-config-minimal = import ./eval-config-minimal.nix { inherit lib; }; + + testing-lib = import ./testing/default.nix { inherit lib; }; in /* This attribute set appears as lib.nixos in the flake, or can be imported @@ -30,4 +32,10 @@ in inherit (seqAttrsIf (!featureFlags?minimalModules) minimalModulesWarning eval-config-minimal) evalModules ; + + inherit (testing-lib) + evalTest + runTest + ; + } diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index 1c331a3c5162..e72e5d476bfa 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -12,6 +12,10 @@ with pkgs; +let + nixos-lib = import ./default.nix { inherit (pkgs) lib; }; +in + rec { inherit pkgs; @@ -166,26 +170,15 @@ rec { ${lib.optionalString (interactive) "--add-flags --interactive"} ''); - evalTest = module: lib.evalModules { modules = testModules ++ [ module ]; }; - runTest = module: (evalTest module).config.run; + evalTest = module: nixos-lib.evalTest { imports = [ extraTestModule module ]; }; + runTest = module: nixos-lib.runTest { imports = [ extraTestModule module ]; }; - testModules = [ - ./testing/driver.nix - ./testing/interactive.nix - ./testing/legacy.nix - ./testing/meta.nix - ./testing/name.nix - ./testing/network.nix - ./testing/nodes.nix - ./testing/pkgs.nix - ./testing/run.nix - ./testing/testScript.nix - { - config = { - hostPkgs = pkgs; - }; - } - ]; + extraTestModule = { + config = { + hostPkgs = pkgs; + minimalResult = hydra; + }; + }; # Make a full-blown test makeTest = diff --git a/nixos/lib/testing/default.nix b/nixos/lib/testing/default.nix new file mode 100644 index 000000000000..676d52f5c3fb --- /dev/null +++ b/nixos/lib/testing/default.nix @@ -0,0 +1,24 @@ +{ lib }: +let + + evalTest = module: lib.evalModules { modules = testModules ++ [ module ]; }; + runTest = module: (evalTest module).config.result; + + testModules = [ + ./call-test.nix + ./driver.nix + ./interactive.nix + ./legacy.nix + ./meta.nix + ./name.nix + ./network.nix + ./nodes.nix + ./pkgs.nix + ./run.nix + ./testScript.nix + ]; + +in +{ + inherit evalTest runTest testModules; +} From 6e2f7539893ebabc92ccb1421a84fccf09b2052b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 15 Jun 2022 18:04:41 +0200 Subject: [PATCH 018/113] nixos/doc/running-nixos-tests-interactively: Describe interactive option --- ...nning-nixos-tests-interactively.section.md | 8 +++++ ...ning-nixos-tests-interactively.section.xml | 32 +++++++++++++------ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/nixos/doc/manual/development/running-nixos-tests-interactively.section.md b/nixos/doc/manual/development/running-nixos-tests-interactively.section.md index a1431859ff59..6170057442df 100644 --- a/nixos/doc/manual/development/running-nixos-tests-interactively.section.md +++ b/nixos/doc/manual/development/running-nixos-tests-interactively.section.md @@ -24,6 +24,8 @@ back into the test driver command line upon its completion. This allows you to inspect the state of the VMs after the test (e.g. to debug the test script). +## Reuse VM state {#sec-nixos-test-reuse-vm-state} + You can re-use the VM states coming from a previous run by setting the `--keep-vm-state` flag. @@ -33,3 +35,9 @@ $ ./result/bin/nixos-test-driver --keep-vm-state The machine state is stored in the `$TMPDIR/vm-state-machinename` directory. + +## Interactive-only test configuration {#sec-nixos-test-interactive-configuration} + +You can add configuration that is specific to the interactive test driver, by adding to the `interactive` option. +`interactive` is a copy of the regular test options namespace, and is used by the interactive test driver. +It can be helpful for troubleshooting changes that you don't want to apply to regular test runs. diff --git a/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml b/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml index 0e47350a0d24..edd3c33ff401 100644 --- a/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml +++ b/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml @@ -25,15 +25,29 @@ $ ./result/bin/nixos-test-driver completion. This allows you to inspect the state of the VMs after the test (e.g. to debug the test script). - - You can re-use the VM states coming from a previous run by setting - the --keep-vm-state flag. - - +
+ Reuse VM state + + You can re-use the VM states coming from a previous run by setting + the --keep-vm-state flag. + + $ ./result/bin/nixos-test-driver --keep-vm-state - - The machine state is stored in the - $TMPDIR/vm-state-machinename directory. - + + The machine state is stored in the + $TMPDIR/vm-state-machinename directory. + +
+
+ Interactive-only test configuration + + You can add configuration that is specific to the interactive test + driver, by adding to the interactive option. + interactive is a copy of the regular test + options namespace, and is used by the interactive test driver. It + can be helpful for troubleshooting changes that you don’t want to + apply to regular test runs. + +
From 537f45637367352b33d2979095765a0bdd2b0d00 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 15 Jun 2022 18:05:48 +0200 Subject: [PATCH 019/113] nixos/doc/running-nixos-tests: Simplify running instructions with nixosTests --- .../development/running-nixos-tests.section.md | 17 +++-------------- .../development/running-nixos-tests.section.xml | 17 +++-------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/nixos/doc/manual/development/running-nixos-tests.section.md b/nixos/doc/manual/development/running-nixos-tests.section.md index 1bec023b613a..33076f5dc2a7 100644 --- a/nixos/doc/manual/development/running-nixos-tests.section.md +++ b/nixos/doc/manual/development/running-nixos-tests.section.md @@ -2,22 +2,11 @@ You can run tests using `nix-build`. For example, to run the test [`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix), -you just do: +you do: ```ShellSession -$ nix-build '' -``` - -or, if you don't want to rely on `NIX_PATH`: - -```ShellSession -$ cd /my/nixpkgs/nixos/tests -$ nix-build login.nix -… -running the VM test script -machine: QEMU running (pid 8841) -… -6 out of 6 tests succeeded +$ cd /my/git/clone/of/nixpkgs +$ nix-build -A nixosTests.login ``` After building/downloading all required dependencies, this will perform diff --git a/nixos/doc/manual/from_md/development/running-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/running-nixos-tests.section.xml index da2e5076c956..23abb546899f 100644 --- a/nixos/doc/manual/from_md/development/running-nixos-tests.section.xml +++ b/nixos/doc/manual/from_md/development/running-nixos-tests.section.xml @@ -4,22 +4,11 @@ You can run tests using nix-build. For example, to run the test login.nix, - you just do: + you do: -$ nix-build '<nixpkgs/nixos/tests/login.nix>' - - - or, if you don’t want to rely on NIX_PATH: - - -$ cd /my/nixpkgs/nixos/tests -$ nix-build login.nix -… -running the VM test script -machine: QEMU running (pid 8841) -… -6 out of 6 tests succeeded +$ cd /my/git/clone/of/nixpkgs +$ nix-build -A nixosTests.login After building/downloading all required dependencies, this will From 38fb09e4278ca3e836da2c175dbff815c06b0632 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 22 Jun 2022 00:41:12 +0200 Subject: [PATCH 020/113] testing-python.nix: Replace makeTest implementation --- nixos/lib/testing-python.nix | 242 +----------------- .../tools/nixos-build-vms/build-vms.nix | 2 +- 2 files changed, 11 insertions(+), 233 deletions(-) diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index e72e5d476bfa..cdaed5fa514c 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -20,156 +20,6 @@ rec { inherit pkgs; - # Run an automated test suite in the given virtual network. - runTests = { driver, driverInteractive, pos }: - stdenv.mkDerivation { - name = "vm-test-run-${driver.testName}"; - - requiredSystemFeatures = [ "kvm" "nixos-test" ]; - - buildCommand = - '' - mkdir -p $out - - # effectively mute the XMLLogger - export LOGFILE=/dev/null - - ${driver}/bin/nixos-test-driver -o $out - ''; - - passthru = driver.passthru // { - inherit driver driverInteractive; - }; - - inherit pos; # for better debugging - }; - - # Generate convenience wrappers for running the test driver - # has vlans, vms and test script defaulted through env variables - # also instantiates test script with nodes, if it's a function (contract) - setupDriverForTest = { - testScript - , testName - , nodes - , qemu_pkg ? pkgs.qemu_test - , enableOCR ? false - , skipLint ? false - , skipTypeCheck ? false - , passthru ? {} - , interactive ? false - , extraPythonPackages ? (_ :[]) - }: - let - # Reifies and correctly wraps the python test driver for - # the respective qemu version and with or without ocr support - testDriver = pkgs.callPackage ./test-driver { - inherit enableOCR extraPythonPackages; - qemu_pkg = qemu_test; - imagemagick_light = imagemagick_light.override { inherit libtiff; }; - tesseract4 = tesseract4.override { enableLanguages = [ "eng" ]; }; - }; - - - testDriverName = - let - # A standard store path to the vm monitor is built like this: - # /tmp/nix-build-vm-test-run-$name.drv-0/vm-state-machine/monitor - # The max filename length of a unix domain socket is 108 bytes. - # This means $name can at most be 50 bytes long. - maxTestNameLen = 50; - testNameLen = builtins.stringLength testName; - in with builtins; - if testNameLen > maxTestNameLen then - abort - ("The name of the test '${testName}' must not be longer than ${toString maxTestNameLen} " + - "it's currently ${toString testNameLen} characters long.") - else - "nixos-test-driver-${testName}"; - - vlans = map (m: m.config.virtualisation.vlans) (lib.attrValues nodes); - vms = map (m: m.config.system.build.vm) (lib.attrValues nodes); - - nodeHostNames = let - nodesList = map (c: c.config.system.name) (lib.attrValues nodes); - in nodesList ++ lib.optional (lib.length nodesList == 1 && !lib.elem "machine" nodesList) "machine"; - - # TODO: This is an implementation error and needs fixing - # the testing famework cannot legitimately restrict hostnames further - # beyond RFC1035 - invalidNodeNames = lib.filter - (node: builtins.match "^[A-z_]([A-z0-9_]+)?$" node == null) - nodeHostNames; - - testScript' = - # Call the test script with the computed nodes. - if lib.isFunction testScript - then testScript { inherit nodes; } - else testScript; - - uniqueVlans = lib.unique (builtins.concatLists vlans); - vlanNames = map (i: "vlan${toString i}: VLan;") uniqueVlans; - machineNames = map (name: "${name}: Machine;") nodeHostNames; - in - if lib.length invalidNodeNames > 0 then - throw '' - Cannot create machines out of (${lib.concatStringsSep ", " invalidNodeNames})! - All machines are referenced as python variables in the testing framework which will break the - script when special characters are used. - - This is an IMPLEMENTATION ERROR and needs to be fixed. Meanwhile, - please stick to alphanumeric chars and underscores as separation. - '' - else lib.warnIf skipLint "Linting is disabled" (runCommand testDriverName - { - inherit testName; - nativeBuildInputs = [ makeWrapper mypy ]; - buildInputs = [ testDriver ]; - testScript = testScript'; - preferLocalBuild = true; - passthru = passthru // { - inherit nodes; - }; - meta.mainProgram = "nixos-test-driver"; - } - '' - mkdir -p $out/bin - - vmStartScripts=($(for i in ${toString vms}; do echo $i/bin/run-*-vm; done)) - - ${lib.optionalString (!skipTypeCheck) '' - # prepend type hints so the test script can be type checked with mypy - cat "${./test-script-prepend.py}" >> testScriptWithTypes - echo "${builtins.toString machineNames}" >> testScriptWithTypes - echo "${builtins.toString vlanNames}" >> testScriptWithTypes - echo -n "$testScript" >> testScriptWithTypes - - mypy --no-implicit-optional \ - --pretty \ - --no-color-output \ - testScriptWithTypes - ''} - - echo -n "$testScript" >> $out/test-script - - ln -s ${testDriver}/bin/nixos-test-driver $out/bin/nixos-test-driver - - ${testDriver}/bin/generate-driver-symbols - ${lib.optionalString (!skipLint) '' - PYFLAKES_BUILTINS="$( - echo -n ${lib.escapeShellArg (lib.concatStringsSep "," nodeHostNames)}, - < ${lib.escapeShellArg "driver-symbols"} - )" ${python3Packages.pyflakes}/bin/pyflakes $out/test-script - ''} - - # set defaults through environment - # see: ./test-driver/test-driver.py argparse implementation - wrapProgram $out/bin/nixos-test-driver \ - --set startScripts "''${vmStartScripts[*]}" \ - --set testScript "$out/test-script" \ - --set vlans '${toString vlans}' \ - ${lib.optionalString (interactive) "--add-flags --interactive"} - ''); - evalTest = module: nixos-lib.evalTest { imports = [ extraTestModule module ]; }; runTest = module: nixos-lib.runTest { imports = [ extraTestModule module ]; }; @@ -199,89 +49,17 @@ rec { else builtins.unsafeGetAttrPos "testScript" t) , extraPythonPackages ? (_ : []) } @ t: - let - mkNodes = qemu_pkg: - let - testScript' = - # Call the test script with the computed nodes. - if lib.isFunction testScript - then testScript { nodes = mkNodes qemu_pkg; } - else testScript; - - build-vms = import ./build-vms.nix { - inherit system lib pkgs minimal specialArgs; - extraConfigurations = extraConfigurations ++ [( - { config, ... }: - { - virtualisation.qemu.package = qemu_pkg; - - # Make sure all derivations referenced by the test - # script are available on the nodes. When the store is - # accessed through 9p, this isn't important, since - # everything in the store is available to the guest, - # but when building a root image it is, as all paths - # that should be available to the guest has to be - # copied to the image. - virtualisation.additionalPaths = - lib.optional - # A testScript may evaluate nodes, which has caused - # infinite recursions. The demand cycle involves: - # testScript --> - # nodes --> - # toplevel --> - # additionalPaths --> - # hasContext testScript' --> - # testScript (ad infinitum) - # If we don't need to build an image, we can break this - # cycle by short-circuiting when useNixStoreImage is false. - (config.virtualisation.useNixStoreImage && builtins.hasContext testScript') - (pkgs.writeStringReferencesToFile testScript'); - - # Ensure we do not use aliases. Ideally this is only set - # when the test framework is used by Nixpkgs NixOS tests. - nixpkgs.config.allowAliases = false; - } - )]; - }; - in - lib.warnIf (t?machine) "In test `${name}': The `machine' attribute in NixOS tests (pkgs.nixosTest / make-test-python.nix / testing-python.nix / makeTest) is deprecated. Please use the equivalent `nodes.machine'." - build-vms.buildVirtualNetwork ( - nodes // lib.optionalAttrs (machine != null) { inherit machine; } - ); - - driver = setupDriverForTest { - inherit testScript enableOCR skipTypeCheck skipLint passthru extraPythonPackages; - testName = name; - qemu_pkg = pkgs.qemu_test; - nodes = mkNodes pkgs.qemu_test; + runTest { + imports = [ + { _file = "makeTest parameters"; config = t; } + { + defaults = { + _file = "makeTest: extraConfigurations"; + imports = extraConfigurations; + }; + } + ]; }; - driverInteractive = setupDriverForTest { - inherit testScript enableOCR skipTypeCheck skipLint passthru extraPythonPackages; - testName = name; - qemu_pkg = pkgs.qemu; - nodes = mkNodes pkgs.qemu; - interactive = true; - }; - - test = lib.addMetaAttrs meta (runTests { inherit driver pos driverInteractive; }); - - in - test // { - inherit test driver driverInteractive; - inherit (driver) nodes; - }; - - abortForFunction = functionName: abort ''The ${functionName} function was - removed because it is not an essential part of the NixOS testing - infrastructure. It had no usage in NixOS or Nixpkgs and it had no designated - maintainer. You are free to reintroduce it by documenting it in the manual - and adding yourself as maintainer. It was removed in - https://github.com/NixOS/nixpkgs/pull/137013 - ''; - - runInMachine = abortForFunction "runInMachine"; - - runInMachineWithX = abortForFunction "runInMachineWithX"; simpleTest = as: (makeTest as).test; diff --git a/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix b/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix index b4a94f62ad93..ced344bce234 100644 --- a/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix +++ b/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix @@ -15,7 +15,7 @@ let inherit system pkgs; }; - interactiveDriver = (testing.makeTest { inherit nodes; testScript = "start_all(); join_all();"; }).driverInteractive; + interactiveDriver = (testing.makeTest { inherit nodes; name = "network"; testScript = "start_all(); join_all();"; }).driverInteractive; in From 24d1d74e4e61e53326b7ed059528693afd17cc50 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 22 Jun 2022 01:12:01 +0200 Subject: [PATCH 021/113] nixos/testing: Extract nixos-test-base.nix NixOS module --- nixos/lib/testing/nixos-test-base.nix | 23 +++++++++++++++++++++++ nixos/lib/testing/nodes.nix | 13 +------------ 2 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 nixos/lib/testing/nixos-test-base.nix diff --git a/nixos/lib/testing/nixos-test-base.nix b/nixos/lib/testing/nixos-test-base.nix new file mode 100644 index 000000000000..59e6e3843367 --- /dev/null +++ b/nixos/lib/testing/nixos-test-base.nix @@ -0,0 +1,23 @@ +# A module containing the base imports and overrides that +# are always applied in NixOS VM tests, unconditionally, +# even in `inheritParentConfig = false` specialisations. +{ lib, ... }: +let + inherit (lib) mkForce; +in +{ + imports = [ + ../../modules/virtualisation/qemu-vm.nix + ../../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs + { key = "no-manual"; documentation.nixos.enable = false; } + { + key = "no-revision"; + # Make the revision metadata constant, in order to avoid needless retesting. + # The human version (e.g. 21.05-pre) is left as is, because it is useful + # for external modules that test with e.g. testers.nixosTest and rely on that + # version number. + config.system.nixos.revision = mkForce "constant-nixos-revision"; + } + + ]; +} diff --git a/nixos/lib/testing/nodes.nix b/nixos/lib/testing/nodes.nix index 98580d5dc4f8..a83c2a52d3ac 100644 --- a/nixos/lib/testing/nodes.nix +++ b/nixos/lib/testing/nodes.nix @@ -12,19 +12,8 @@ let modules = [ config.defaults ]; baseModules = (import ../../modules/module-list.nix) ++ [ - ../../modules/virtualisation/qemu-vm.nix - ../../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs - { key = "no-manual"; documentation.nixos.enable = false; } - { - key = "no-revision"; - # Make the revision metadata constant, in order to avoid needless retesting. - # The human version (e.g. 21.05-pre) is left as is, because it is useful - # for external modules that test with e.g. testers.nixosTest and rely on that - # version number. - config.system.nixos.revision = mkForce "constant-nixos-revision"; - } + ./nixos-test-base.nix { key = "nodes"; _module.args.nodes = nodes; } - ({ config, ... }: { virtualisation.qemu.package = testModuleArgs.config.qemu.package; From 57ac9dd3aeae93b9c4fa6e4a58792b7981535180 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 22 Jun 2022 00:50:53 +0200 Subject: [PATCH 022/113] nixos/lib/build-vms.nix: Remove It has been replaced by the modular test framework in nixos/lib/testing. If you are looking for a way to produce a VM-test-like configuration outside of the test framework, use the nixos/lib/testing/nixos-test-base.nix NixOS module, possibly in combination with { _module.args.nodes = .....; }. --- nixos/lib/build-vms.nix | 113 ---------------------------------------- 1 file changed, 113 deletions(-) delete mode 100644 nixos/lib/build-vms.nix diff --git a/nixos/lib/build-vms.nix b/nixos/lib/build-vms.nix deleted file mode 100644 index 18af49db1777..000000000000 --- a/nixos/lib/build-vms.nix +++ /dev/null @@ -1,113 +0,0 @@ -{ system -, # Use a minimal kernel? - minimal ? false -, # Ignored - config ? null -, # Nixpkgs, for qemu, lib and more - pkgs, lib -, # !!! See comment about args in lib/modules.nix - specialArgs ? {} -, # NixOS configuration to add to the VMs - extraConfigurations ? [] -}: - -with lib; - -rec { - - inherit pkgs; - - # Build a virtual network from an attribute set `{ machine1 = - # config1; ... machineN = configN; }', where `machineX' is the - # hostname and `configX' is a NixOS system configuration. Each - # machine is given an arbitrary IP address in the virtual network. - buildVirtualNetwork = - nodes: let nodesOut = mapAttrs (n: buildVM nodesOut) (assignIPAddresses nodes); in nodesOut; - - - buildVM = - nodes: configurations: - - import ./eval-config.nix { - inherit system specialArgs; - modules = configurations ++ extraConfigurations; - baseModules = (import ../modules/module-list.nix) ++ - [ ../modules/virtualisation/qemu-vm.nix - ../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs - { key = "no-manual"; documentation.nixos.enable = false; } - { key = "no-revision"; - # Make the revision metadata constant, in order to avoid needless retesting. - # The human version (e.g. 21.05-pre) is left as is, because it is useful - # for external modules that test with e.g. testers.nixosTest and rely on that - # version number. - config.system.nixos.revision = mkForce "constant-nixos-revision"; - } - { key = "nodes"; _module.args.nodes = nodes; } - ] ++ optional minimal ../modules/testing/minimal-kernel.nix; - }; - - - # Given an attribute set { machine1 = config1; ... machineN = - # configN; }, sequentially assign IP addresses in the 192.168.1.0/24 - # range to each machine, and set the hostname to the attribute name. - assignIPAddresses = nodes: - - let - - machines = attrNames nodes; - - machinesNumbered = zipLists machines (range 1 254); - - nodes_ = forEach machinesNumbered (m: nameValuePair m.fst - [ ( { config, nodes, ... }: - let - interfacesNumbered = zipLists config.virtualisation.vlans (range 1 255); - interfaces = forEach interfacesNumbered ({ fst, snd }: - nameValuePair "eth${toString snd}" { ipv4.addresses = - [ { address = "192.168.${toString fst}.${toString m.snd}"; - prefixLength = 24; - } ]; - }); - - networkConfig = - { networking.hostName = mkDefault m.fst; - - networking.interfaces = listToAttrs interfaces; - - networking.primaryIPAddress = - optionalString (interfaces != []) (head (head interfaces).value.ipv4.addresses).address; - - # Put the IP addresses of all VMs in this machine's - # /etc/hosts file. If a machine has multiple - # interfaces, use the IP address corresponding to - # the first interface (i.e. the first network in its - # virtualisation.vlans option). - networking.extraHosts = flip concatMapStrings machines - (m': let config = (getAttr m' nodes).config; in - optionalString (config.networking.primaryIPAddress != "") - ("${config.networking.primaryIPAddress} " + - optionalString (config.networking.domain != null) - "${config.networking.hostName}.${config.networking.domain} " + - "${config.networking.hostName}\n")); - - virtualisation.qemu.options = - let qemu-common = import ../lib/qemu-common.nix { inherit lib pkgs; }; - in flip concatMap interfacesNumbered - ({ fst, snd }: qemu-common.qemuNICFlags snd fst m.snd); - }; - - in - { key = "ip-address"; - config = networkConfig // { - # Expose the networkConfig items for tests like nixops - # that need to recreate the network config. - system.build.networkConfig = networkConfig; - }; - } - ) - (getAttr m.fst nodes) - ] ); - - in listToAttrs nodes_; - -} From 5297d584bcc5f95c8e87c631813b4e2ab7f19ecc Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 22 Jun 2022 01:01:34 +0200 Subject: [PATCH 023/113] nixos/lib/eval-config: Document the use of baseModules --- nixos/lib/eval-config.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/lib/eval-config.nix b/nixos/lib/eval-config.nix index 791a03a3ba3c..1e086271e523 100644 --- a/nixos/lib/eval-config.nix +++ b/nixos/lib/eval-config.nix @@ -17,6 +17,8 @@ evalConfigArgs@ # be set modularly anyway. pkgs ? null , # !!! what do we gain by making this configurable? + # we can add modules that are included in specialisations, regardless + # of inheritParentConfig. baseModules ? import ../modules/module-list.nix , # !!! See comment about args in lib/modules.nix extraArgs ? {} From 9886db059a822f9bc1f8fbdacfd1ca1938fe9ebf Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 25 Jun 2022 12:47:50 +0200 Subject: [PATCH 024/113] nixos/testing: Embrace callTest My conception of its input was wrong. It is quite a useful construct, even if its name is a bit weird. --- nixos/lib/testing-python.nix | 1 - nixos/lib/testing/run.nix | 20 +++++++++++--------- nixos/release.nix | 8 ++++---- nixos/tests/all-tests.nix | 21 +++++++++++++++++---- pkgs/top-level/all-packages.nix | 4 ++-- 5 files changed, 34 insertions(+), 20 deletions(-) diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index cdaed5fa514c..fd34fe23d767 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -26,7 +26,6 @@ rec { extraTestModule = { config = { hostPkgs = pkgs; - minimalResult = hydra; }; }; diff --git a/nixos/lib/testing/run.nix b/nixos/lib/testing/run.nix index 65bcbe720bf3..cc31914f745d 100644 --- a/nixos/lib/testing/run.nix +++ b/nixos/lib/testing/run.nix @@ -16,22 +16,22 @@ in ''; }; - run = mkOption { + test = mkOption { type = types.package; description = '' - Derivation that runs the test. + Derivation that runs the test as its "build" process. ''; }; }; config = { - run = hostPkgs.stdenv.mkDerivation { - name = "vm-test-run-${config.name}"; + test = lib.lazyDerivation { # lazyDerivation improves performance when only passthru items and/or meta are used. + derivation = hostPkgs.stdenv.mkDerivation { + name = "vm-test-run-${config.name}"; - requiredSystemFeatures = [ "kvm" "nixos-test" ]; + requiredSystemFeatures = [ "kvm" "nixos-test" ]; - buildCommand = - '' + buildCommand = '' mkdir -p $out # effectively mute the XMLLogger @@ -40,9 +40,11 @@ in ${config.driver}/bin/nixos-test-driver -o $out ''; - passthru = config.passthru; + passthru = config.passthru; - meta = config.meta; + meta = config.meta; + }; + inherit (config) passthru meta; }; # useful for inspection (debugging / exploration) diff --git a/nixos/release.nix b/nixos/release.nix index f70b02c4292b..4f27e5dbb215 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -22,8 +22,8 @@ let import ./tests/all-tests.nix { inherit system; pkgs = import ./.. { inherit system; }; - callTest = t: { - ${system} = hydraJob t.test; + callTest = config: { + ${system} = hydraJob config.test; }; } // { # for typechecking of the scripts and evaluation of @@ -32,8 +32,8 @@ let import ./tests/all-tests.nix { inherit system; pkgs = import ./.. { inherit system; }; - callTest = t: { - ${system} = hydraJob t.test.driver; + callTest = config: { + ${system} = hydraJob config.driver; }; }; }; diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 5cd58cb5c3fd..62e05fcf2b1e 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1,4 +1,11 @@ -{ system, pkgs, callTest }: +{ system, + pkgs, + + # Projects the test configuration into a the desired value; usually + # the test runner: `config: config.test`. + callTest, + +}: # The return value of this function will be an attrset with arbitrary depth and # the `anything` returned by callTest at its test leafs. # The tests not supported by `system` will be replaced with `{}`, so that @@ -29,11 +36,17 @@ let inherit (rec { - doRunTest = (import ../lib/testing-python.nix { inherit system pkgs; }).runTest; + doRunTest = arg: (import ../lib/testing-python.nix { inherit system pkgs; }).runTest { + imports = [ arg { inherit callTest; } ]; + }; findTests = tree: if tree?recurseForDerivations && tree.recurseForDerivations - then mapAttrs (k: findTests) (builtins.removeAttrs tree ["recurseForDerivations"]) - else callTest ({ test = tree; }); + then + mapAttrs + (k: findTests) + (builtins.removeAttrs tree ["recurseForDerivations"]) + else callTest tree; + runTest = arg: let r = doRunTest arg; in findTests r; runTestOn = systems: arg: if elem system systems then runTest arg diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ec53eedd77ff..d369fafdcc49 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -140,14 +140,14 @@ with pkgs; nixosTests = import ../../nixos/tests/all-tests.nix { inherit pkgs; system = stdenv.hostPlatform.system; - callTest = t: t.test; + callTest = config: config.test; } // { # for typechecking of the scripts and evaluation of # the nodes, without running VMs. allDrivers = import ../../nixos/tests/all-tests.nix { inherit pkgs; system = stdenv.hostPlatform.system; - callTest = t: t.test.driver; + callTest = config: config.test.driver; }; }; From e77913a680bc9e7bfd2c93047ecfd6697e2402d7 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 25 Jun 2022 21:26:50 +0200 Subject: [PATCH 025/113] nixos/all-tests.nix: Invoke tests based on make-test-python.nix --- nixos/tests/all-tests.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 62e05fcf2b1e..21e75561964b 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -18,9 +18,18 @@ with pkgs.lib; let discoverTests = val: - if !isAttrs val then val - else if hasAttr "test" val then callTest val - else mapAttrs (n: s: discoverTests s) val; + if isAttrs val + then + if hasAttr "test" val then callTest val + else mapAttrs (n: s: discoverTests s) val + else if isFunction val + then + # Tests based on make-test-python.nix will return the second lambda + # in that file, which are then forwarded to the test definition + # following the `import make-test-python.nix` expression + # (if it is a function). + discoverTests (val { inherit system pkgs; }) + else val; handleTest = path: args: discoverTests (import path ({ inherit system pkgs; } // args)); handleTestOn = systems: path: args: From f01fec40994463da0157e8833969c37e4c03ba25 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 25 Jun 2022 23:29:49 +0200 Subject: [PATCH 026/113] nixos/testing/network.nix: Fix specialisations onlyShorthand --- nixos/lib/testing/network.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nixos/lib/testing/network.nix b/nixos/lib/testing/network.nix index c87abee30c93..4c00a0ba45d3 100644 --- a/nixos/lib/testing/network.nix +++ b/nixos/lib/testing/network.nix @@ -93,11 +93,15 @@ let specialisation = mkOption { type = types.attrsOf (types.submodule { options.configuration = mkOption { - type = types.submodule ({ - config.virtualisation.test.nodeName = - # assert regular.config.virtualisation.test.nodeName != "configuration"; - regular.config.virtualisation.test.nodeName; - }); + type = types.submoduleWith { + modules = [ + { + config.virtualisation.test.nodeName = + # assert regular.config.virtualisation.test.nodeName != "configuration"; + regular.config.virtualisation.test.nodeName; + } + ]; + }; }; }); }; From 0af6e6b0e5c3919190c0eca0b42dc10cab82458f Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 26 Jun 2022 00:13:03 +0200 Subject: [PATCH 027/113] nixos/testing/meta.nix: Add options, some optional --- nixos/lib/testing/meta.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/nixos/lib/testing/meta.nix b/nixos/lib/testing/meta.nix index 1312d6a986ec..07ab27b11f8f 100644 --- a/nixos/lib/testing/meta.nix +++ b/nixos/lib/testing/meta.nix @@ -4,9 +4,25 @@ let in { options = { - meta.maintainers = lib.mkOption { - type = types.listOf types.raw; - default = []; + meta = lib.mkOption { + apply = lib.filterAttrs (k: v: v != null); + type = types.submodule { + options = { + maintainers = lib.mkOption { + type = types.listOf types.raw; + default = []; + }; + timeout = lib.mkOption { + type = types.nullOr types.int; + default = null; + }; + broken = lib.mkOption { + type = types.bool; + default = false; + }; + }; + }; + default = {}; }; }; } From e260018f9c356ff6f82d19b37f0501f8a19f29c0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 26 Jun 2022 00:14:38 +0200 Subject: [PATCH 028/113] nixos/tests: Add names --- nixos/tests/corerad.nix | 1 + nixos/tests/ghostunnel.nix | 1 + nixos/tests/lorri/default.nix | 2 ++ nixos/tests/matomo.nix | 2 ++ nixos/tests/matrix/conduit.nix | 2 ++ nixos/tests/nixops/default.nix | 1 + nixos/tests/pam/pam-file-contents.nix | 1 + nixos/tests/pppd.nix | 2 ++ nixos/tests/thelounge.nix | 2 ++ nixos/tests/zrepl.nix | 2 ++ 10 files changed, 16 insertions(+) diff --git a/nixos/tests/corerad.nix b/nixos/tests/corerad.nix index 638010f92f44..b6f5d7fc6f75 100644 --- a/nixos/tests/corerad.nix +++ b/nixos/tests/corerad.nix @@ -1,5 +1,6 @@ import ./make-test-python.nix ( { + name = "corerad"; nodes = { router = {config, pkgs, ...}: { config = { diff --git a/nixos/tests/ghostunnel.nix b/nixos/tests/ghostunnel.nix index 8bea64854021..91a7b7085f67 100644 --- a/nixos/tests/ghostunnel.nix +++ b/nixos/tests/ghostunnel.nix @@ -1,4 +1,5 @@ import ./make-test-python.nix ({ pkgs, ... }: { + name = "ghostunnel"; nodes = { backend = { pkgs, ... }: { services.nginx.enable = true; diff --git a/nixos/tests/lorri/default.nix b/nixos/tests/lorri/default.nix index 209b87f9f26a..a4bdc92490ce 100644 --- a/nixos/tests/lorri/default.nix +++ b/nixos/tests/lorri/default.nix @@ -1,4 +1,6 @@ import ../make-test-python.nix { + name = "lorri"; + nodes.machine = { pkgs, ... }: { imports = [ ../../modules/profiles/minimal.nix ]; environment.systemPackages = [ pkgs.lorri ]; diff --git a/nixos/tests/matomo.nix b/nixos/tests/matomo.nix index 526a24fc4db7..0e09ad295f95 100644 --- a/nixos/tests/matomo.nix +++ b/nixos/tests/matomo.nix @@ -7,6 +7,8 @@ with pkgs.lib; let matomoTest = package: makeTest { + name = "matomo"; + nodes.machine = { config, pkgs, ... }: { services.matomo = { package = package; diff --git a/nixos/tests/matrix/conduit.nix b/nixos/tests/matrix/conduit.nix index 780837f962fa..2b81c23598eb 100644 --- a/nixos/tests/matrix/conduit.nix +++ b/nixos/tests/matrix/conduit.nix @@ -3,6 +3,8 @@ import ../make-test-python.nix ({ pkgs, ... }: name = "conduit"; in { + name = "matrix-conduit"; + nodes = { conduit = args: { services.matrix-conduit = { diff --git a/nixos/tests/nixops/default.nix b/nixos/tests/nixops/default.nix index 227b38815073..b77ac2476398 100644 --- a/nixos/tests/nixops/default.nix +++ b/nixos/tests/nixops/default.nix @@ -19,6 +19,7 @@ let }); testLegacyNetwork = { nixopsPkg }: pkgs.nixosTest ({ + name = "nixops-legacy-network"; nodes = { deployer = { config, lib, nodes, pkgs, ... }: { imports = [ ../../modules/installer/cd-dvd/channel.nix ]; diff --git a/nixos/tests/pam/pam-file-contents.nix b/nixos/tests/pam/pam-file-contents.nix index 86c61003aeb6..2bafd90618e9 100644 --- a/nixos/tests/pam/pam-file-contents.nix +++ b/nixos/tests/pam/pam-file-contents.nix @@ -2,6 +2,7 @@ let name = "pam"; in import ../make-test-python.nix ({ pkgs, ... }: { + name = "pam-file-contents"; nodes.machine = { ... }: { imports = [ ../../modules/profiles/minimal.nix ]; diff --git a/nixos/tests/pppd.nix b/nixos/tests/pppd.nix index bda0aa75bb50..e714a6c21a6c 100644 --- a/nixos/tests/pppd.nix +++ b/nixos/tests/pppd.nix @@ -5,6 +5,8 @@ import ./make-test-python.nix ( mode = "0640"; }; in { + name = "pppd"; + nodes = { server = {config, pkgs, ...}: { config = { diff --git a/nixos/tests/thelounge.nix b/nixos/tests/thelounge.nix index e9b85685bf2d..8d5a37d46c46 100644 --- a/nixos/tests/thelounge.nix +++ b/nixos/tests/thelounge.nix @@ -1,4 +1,6 @@ import ./make-test-python.nix { + name = "thelounge"; + nodes = { private = { config, pkgs, ... }: { services.thelounge = { diff --git a/nixos/tests/zrepl.nix b/nixos/tests/zrepl.nix index 85dd834a6aaf..0ed73fea34b0 100644 --- a/nixos/tests/zrepl.nix +++ b/nixos/tests/zrepl.nix @@ -1,5 +1,7 @@ import ./make-test-python.nix ( { + name = "zrepl"; + nodes.host = {config, pkgs, ...}: { config = { # Prerequisites for ZFS and tests. From 583a4f0275c0c06e7c99758b0aa66aa738a098ab Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 26 Jun 2022 00:15:00 +0200 Subject: [PATCH 029/113] nixos/tests/cri-o: Fix maintainers --- nixos/tests/cri-o.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/cri-o.nix b/nixos/tests/cri-o.nix index d3a8713d6a9b..08e1e8f36b06 100644 --- a/nixos/tests/cri-o.nix +++ b/nixos/tests/cri-o.nix @@ -1,7 +1,7 @@ # This test runs CRI-O and verifies via critest import ./make-test-python.nix ({ pkgs, ... }: { name = "cri-o"; - meta.maintainers = with pkgs.lib.maintainers; teams.podman.members; + meta.maintainers = with pkgs.lib; teams.podman.members; nodes = { crio = { From 9303a3c73bd45f95997ea52597f901bb8759fd2d Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 26 Jun 2022 00:15:17 +0200 Subject: [PATCH 030/113] nixos/tests/installed-tests: Fix maintainers --- nixos/tests/installed-tests/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/installed-tests/default.nix b/nixos/tests/installed-tests/default.nix index 3bb678d36782..b2c1b43f90ee 100644 --- a/nixos/tests/installed-tests/default.nix +++ b/nixos/tests/installed-tests/default.nix @@ -40,7 +40,7 @@ let name = tested.name; meta = { - maintainers = tested.meta.maintainers; + maintainers = tested.meta.maintainers or []; }; nodes.machine = { ... }: { From 52bfa318e8797cffbd4750efbb59cc4d276187a6 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 26 Jun 2022 13:57:58 +0200 Subject: [PATCH 031/113] nixos/testing: Support mypy through regular mechanisms Rebase / forward port of 2c8bbf33fd84d2fd9de70d66c1f50ac1b6123dd8 --- nixos/lib/testing/driver.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/lib/testing/driver.nix b/nixos/lib/testing/driver.nix index 9473d888cbb8..b041693686eb 100644 --- a/nixos/lib/testing/driver.nix +++ b/nixos/lib/testing/driver.nix @@ -52,6 +52,7 @@ let nativeBuildInputs = [ hostPkgs.makeWrapper ] ++ lib.optionals (!config.skipTypeCheck) [ hostPkgs.mypy ]; + buildInputs = [ testDriver ]; testScript = config.testScriptString; preferLocalBuild = true; passthru = config.passthru; @@ -73,13 +74,10 @@ let cat -n testScriptWithTypes - # set pythonpath so mypy knows where to find the imports. this requires the py.typed file. - export PYTHONPATH='${../test-driver}' mypy --no-implicit-optional \ --pretty \ --no-color-output \ testScriptWithTypes - unset PYTHONPATH ''} echo -n "$testScript" >> $out/test-script From 618f82406fb5ef9d57b04c965516c35f41d0e7a3 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 26 Jun 2022 14:59:21 +0200 Subject: [PATCH 032/113] nixos/tests/installer: Fix docbook dependency --- nixos/tests/installer.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index 8bef4fad3dd2..9e2eca8daa3a 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -324,6 +324,9 @@ let desktop-file-utils docbook5 docbook_xsl_ns + (docbook-xsl-ns.override { + withManOptDedupPatch = true; + }) kmod.dev libarchive.dev libxml2.bin @@ -333,6 +336,7 @@ let perlPackages.ListCompare perlPackages.XMLLibXML python3Minimal + python3Packages.mistune shared-mime-info sudo texinfo From 4ce93fbae87bac1b4054b4875d607bcc00ba92bb Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 27 Jun 2022 13:05:59 +0200 Subject: [PATCH 033/113] nixos/testing-python: Add interactive variant support to makeTest --- nixos/lib/testing-python.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index fd34fe23d767..c303b0bf17bc 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -47,6 +47,7 @@ rec { then builtins.unsafeGetAttrPos "description" meta else builtins.unsafeGetAttrPos "testScript" t) , extraPythonPackages ? (_ : []) + , interactive ? {} } @ t: runTest { imports = [ From 6205d377477042582adc533197b1a05fbac6ddd0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 27 Jun 2022 20:06:30 +0200 Subject: [PATCH 034/113] nixos/testing: Improve option docs --- doc/stdenv/meta.chapter.md | 4 ++ nixos/doc/manual/default.nix | 2 + .../writing-nixos-tests.section.md | 14 +++---- .../writing-nixos-tests.section.xml | 32 +++++++++------- nixos/lib/testing/driver.nix | 31 +++++++++++----- nixos/lib/testing/interactive.nix | 11 +++++- nixos/lib/testing/meta.nix | 18 ++++++++- nixos/lib/testing/name.nix | 13 +++++-- nixos/lib/testing/network.nix | 5 ++- nixos/lib/testing/nodes.nix | 37 +++++++++++++++++-- nixos/lib/testing/run.nix | 10 +++-- nixos/lib/testing/testScript.nix | 10 ++++- 12 files changed, 141 insertions(+), 46 deletions(-) diff --git a/doc/stdenv/meta.chapter.md b/doc/stdenv/meta.chapter.md index 51ad29b4b16e..a83aa0bd90f8 100644 --- a/doc/stdenv/meta.chapter.md +++ b/doc/stdenv/meta.chapter.md @@ -213,6 +213,10 @@ runCommand "my-package-test" { A timeout (in seconds) for building the derivation. If the derivation takes longer than this time to build, it can fail due to breaking the timeout. However, all computers do not have the same computing power, hence some builders may decide to apply a multiplicative factor to this value. When filling this value in, try to keep it approximately consistent with other values already present in `nixpkgs`. +`meta` attributes are not stored in the instantiated derivation. +Therefore, this setting may be lost when the package is used as a dependency. +To be effective, it must be presented directly to an evaluation process that handles the `meta.timeout` attribute. + ### `hydraPlatforms` {#var-meta-hydraPlatforms} The list of Nix platform types for which the Hydra instance at `hydra.nixos.org` will build the package. (Hydra is the Nix-based continuous build system.) It defaults to the value of `meta.platforms`. Thus, the only reason to set `meta.hydraPlatforms` is if you want `hydra.nixos.org` to build the package on a subset of `meta.platforms`, or not at all, e.g. diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index d61bbaddf764..5eaa44106012 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -13,6 +13,8 @@ with pkgs; let + inherit (lib) hasPrefix removePrefix; + lib = pkgs.lib; docbook_xsl_ns = pkgs.docbook-xsl-ns.override { diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md index 8dd3e6fb7597..1d8c0a2a664a 100644 --- a/nixos/doc/manual/development/writing-nixos-tests.section.md +++ b/nixos/doc/manual/development/writing-nixos-tests.section.md @@ -22,12 +22,12 @@ A NixOS test is a module that has the following structure: ``` We refer to the whole test above as a test module, whereas the values -in `nodes.` are NixOS modules. (A NixOS configuration is a module.) +in [`nodes.`](#opt-nodes) are NixOS modules themselves. -The option `testScript` is a bit of Python code that executes the +The option [`testScript`](#opt-testScript) is a piece of Python code that executes the test (described below). During the test, it will start one or more virtual machines, the configuration of which is described by -the attribute `nodes`. +the option [`nodes`](#opt-nodes). An example of a single-node test is [`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix). @@ -58,7 +58,7 @@ For the purpose of constructing a test matrix, use the `matrix` options instead. hostname = runTest { imports = [ ./hostname.nix ]; defaults.networking.firewall.enable = false; }; ``` -You can run a test with attribute name `mytest` in `all-tests.nix` by invoking: +You can run a test with attribute name `mytest` in `nixos/tests/all-tests.nix` by invoking: ```shell nix-build -A nixosTests.mytest @@ -181,7 +181,7 @@ The following methods are available on machine objects: least one will be returned. ::: {.note} - This requires passing `enableOCR` to the test attribute set. + This requires [`enableOCR`](#opt-enableOCR) to be set to `true`. ::: `get_screen_text` @@ -190,7 +190,7 @@ The following methods are available on machine objects: machine\'s screen using optical character recognition. ::: {.note} - This requires passing `enableOCR` to the test attribute set. + This requires [`enableOCR`](#opt-enableOCR) to be set to `true`. ::: `send_monitor_command` @@ -301,7 +301,7 @@ The following methods are available on machine objects: `get_screen_text` and `get_screen_text_variants`). ::: {.note} - This requires passing `enableOCR` to the test attribute set. + This requires [`enableOCR`](#opt-enableOCR) to be set to `true`. ::: `wait_for_console_text` diff --git a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml index 6d0465e4230b..4910f0e863b5 100644 --- a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml +++ b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml @@ -23,14 +23,17 @@
We refer to the whole test above as a test module, whereas the - values in nodes.<name> are NixOS modules. - (A NixOS configuration is a module.) + values in + nodes.<name> + are NixOS modules themselves. - The option testScript is a bit of Python code - that executes the test (described below). During the test, it will - start one or more virtual machines, the configuration of which is - described by the attribute nodes. + The option + testScript + is a piece of Python code that executes the test (described below). + During the test, it will start one or more virtual machines, the + configuration of which is described by the option + nodes. An example of a single-node test is @@ -73,7 +76,7 @@ You can run a test with attribute name mytest - in all-tests.nix by invoking: + in nixos/tests/all-tests.nix by invoking: nix-build -A nixosTests.mytest @@ -270,8 +273,9 @@ start_all() - This requires passing enableOCR to the - test attribute set. + This requires + enableOCR + to be set to true. @@ -287,8 +291,9 @@ start_all() - This requires passing enableOCR to the - test attribute set. + This requires + enableOCR + to be set to true. @@ -527,8 +532,9 @@ start_all() - This requires passing enableOCR to the - test attribute set. + This requires + enableOCR + to be set to true. diff --git a/nixos/lib/testing/driver.nix b/nixos/lib/testing/driver.nix index b041693686eb..04e99f9e21d6 100644 --- a/nixos/lib/testing/driver.nix +++ b/nixos/lib/testing/driver.nix @@ -1,6 +1,6 @@ { config, lib, hostPkgs, ... }: let - inherit (lib) mkOption types; + inherit (lib) mkOption types literalMD mdDoc; # Reifies and correctly wraps the python test driver for # the respective qemu version and with or without ocr support @@ -106,13 +106,13 @@ in options = { driver = mkOption { - description = "Script that runs the test."; + description = mdDoc "Package containing a script that runs the test."; type = types.package; - defaultText = lib.literalDocBook "set by the test framework"; + defaultText = literalMD "set by the test framework"; }; hostPkgs = mkOption { - description = "Nixpkgs attrset used outside the nodes."; + description = mdDoc "Nixpkgs attrset used outside the nodes."; type = types.raw; example = lib.literalExpression '' import nixpkgs { inherit system config overlays; } @@ -120,34 +120,39 @@ in }; qemu.package = mkOption { - description = "Which qemu package to use."; + description = mdDoc "Which qemu package to use for the virtualisation of [{option}`nodes`](#opt-nodes)."; type = types.package; default = hostPkgs.qemu_test; defaultText = "hostPkgs.qemu_test"; }; enableOCR = mkOption { - description = '' + description = mdDoc '' Whether to enable Optical Character Recognition functionality for - testing graphical programs. + testing graphical programs. See [Machine objects](`ssec-machine-objects`). ''; type = types.bool; default = false; }; extraPythonPackages = mkOption { - description = '' + description = mdDoc '' Python packages to add to the test driver. The argument is a Python package set, similar to `pkgs.pythonPackages`. ''; + example = lib.literalExpression '' + p: [ p.numpy ] + ''; type = types.functionTo (types.listOf types.package); default = ps: [ ]; }; extraDriverArgs = mkOption { - description = '' + description = mdDoc '' Extra arguments to pass to the test driver. + + They become part of [{option}`driver`](#opt-driver) via `wrapProgram`. ''; type = types.listOf types.str; default = []; @@ -156,11 +161,19 @@ in skipLint = mkOption { type = types.bool; default = false; + description = mdDoc '' + Do not run the linters. This may speed up your iteration cycle, but it is not something you should commit. + ''; }; skipTypeCheck = mkOption { type = types.bool; default = false; + description = mdDoc '' + Disable type checking. This must not be enabled for new NixOS tests. + + This may speed up your iteration cycle, unless you're working on the [{option}`testScript`](#opt-testScript). + ''; }; }; diff --git a/nixos/lib/testing/interactive.nix b/nixos/lib/testing/interactive.nix index fd4d481a3f82..43886fa72678 100644 --- a/nixos/lib/testing/interactive.nix +++ b/nixos/lib/testing/interactive.nix @@ -1,12 +1,19 @@ { config, lib, moduleType, hostPkgs, ... }: let - inherit (lib) mkOption types; + inherit (lib) mkOption types mdDoc; in { options = { interactive = mkOption { - description = "All the same options, but configured for interactive use."; + description = mdDoc '' + Tests [can be run interactively](#sec-running-nixos-tests-interactively). + + When they are, the configuration will include anything set in this submodule. + + You can set any top-level test option here. + ''; type = moduleType; + visible = "shallow"; }; }; diff --git a/nixos/lib/testing/meta.nix b/nixos/lib/testing/meta.nix index 07ab27b11f8f..4d8b0e0f1c43 100644 --- a/nixos/lib/testing/meta.nix +++ b/nixos/lib/testing/meta.nix @@ -1,24 +1,38 @@ { lib, ... }: let - inherit (lib) types mkOption; + inherit (lib) types mkOption mdDoc; in { options = { meta = lib.mkOption { + description = mdDoc '' + The [`meta`](https://nixos.org/manual/nixpkgs/stable/#chap-meta) attributes that will be set on the returned derivations. + + Not all [`meta`](https://nixos.org/manual/nixpkgs/stable/#chap-meta) attributes are supported, but more can be added as desired. + ''; apply = lib.filterAttrs (k: v: v != null); type = types.submodule { options = { maintainers = lib.mkOption { type = types.listOf types.raw; default = []; + description = mdDoc '' + The [list of maintainers](https://nixos.org/manual/nixpkgs/stable/#var-meta-maintainers) for this test. + ''; }; timeout = lib.mkOption { type = types.nullOr types.int; - default = null; + default = null; # NOTE: null values are filtered out by `meta`. + description = mdDoc '' + The [{option}`test`](#opt-test)'s [`meta.timeout`](https://nixos.org/manual/nixpkgs/stable/#var-meta-timeout) in seconds. + ''; }; broken = lib.mkOption { type = types.bool; default = false; + description = mdDoc '' + Sets the [`meta.broken`](https://nixos.org/manual/nixpkgs/stable/#var-meta-broken) attribute on the [{option}`test`](#opt-test) derivation. + ''; }; }; }; diff --git a/nixos/lib/testing/name.nix b/nixos/lib/testing/name.nix index f9fa488511c0..a54622e139bf 100644 --- a/nixos/lib/testing/name.nix +++ b/nixos/lib/testing/name.nix @@ -1,7 +1,14 @@ { lib, ... }: +let + inherit (lib) mkOption types mdDoc; +in { - options.name = lib.mkOption { - description = "The name of the test."; - type = lib.types.str; + options.name = mkOption { + description = mdDoc '' + The name of the test. + + This is used in the derivation names of the [{option}`driver`](#opt-driver) and [{option}`test`](#opt-test) runner. + ''; + type = types.str; }; } diff --git a/nixos/lib/testing/network.nix b/nixos/lib/testing/network.nix index 4c00a0ba45d3..513ec7a14092 100644 --- a/nixos/lib/testing/network.nix +++ b/nixos/lib/testing/network.nix @@ -5,6 +5,7 @@ let attrNames concatMap concatMapStrings flip forEach head listToAttrs mkDefault mkOption nameValuePair optionalString range types zipListsWith zipLists + mdDoc ; nodeNumbers = @@ -74,7 +75,7 @@ let default = name; # We need to force this in specilisations, otherwise it'd be # readOnly = true; - description = '' + description = mdDoc '' The `name` in `nodes.`; stable across `specialisations`. ''; }; @@ -83,7 +84,7 @@ let type = types.int; readOnly = true; default = nodeNumbers.${config.virtualisation.test.nodeName}; - description = '' + description = mdDoc '' A unique number assigned for each node in `nodes`. ''; }; diff --git a/nixos/lib/testing/nodes.nix b/nixos/lib/testing/nodes.nix index a83c2a52d3ac..624fc384c7ec 100644 --- a/nixos/lib/testing/nodes.nix +++ b/nixos/lib/testing/nodes.nix @@ -1,7 +1,7 @@ testModuleArgs@{ config, lib, hostPkgs, nodes, ... }: let - inherit (lib) mkOption mkForce optional types mapAttrs mkDefault; + inherit (lib) mkOption mkForce optional types mapAttrs mkDefault mdDoc; system = hostPkgs.stdenv.hostPlatform.system; @@ -39,11 +39,29 @@ in nodes = mkOption { type = types.lazyAttrsOf config.node.type; + visible = "shallow"; + description = mdDoc '' + An attribute set of NixOS configuration modules. + + The configurations are augmented by the [`defaults`](#opt-defaults) option. + + They are assigned network addresses according to the `nixos/lib/testing/network.nix` module. + + A few special options are available, that aren't in a plain NixOS configuration. See [Configuring the nodes](#sec-nixos-test-nodes) + ''; }; defaults = mkOption { - description = '' - NixOS configuration that is applied to all {option}`nodes`. + description = mdDoc '' + NixOS configuration that is applied to all [{option}`nodes`](#opt-nodes). + ''; + type = types.deferredModule; + default = { }; + }; + + extraBaseModules = mkOption { + description = mdDoc '' + NixOS configuration that, like [{option}`defaults`](#opt-defaults), is applied to all [{option}`nodes`](#opt-nodes) and can not be undone with [`specialisation..inheritParentConfig`](https://search.nixos.org/options?show=specialisation.%3Cname%3E.inheritParentConfig&from=0&size=50&sort=relevance&type=packages&query=specialisation). ''; type = types.deferredModule; default = { }; @@ -52,15 +70,28 @@ in node.specialArgs = mkOption { type = types.lazyAttrsOf types.raw; default = { }; + description = mdDoc '' + An attribute set of arbitrary values that will be made available as module arguments during the resolution of module `imports`. + + Note that it is not possible to override these from within the NixOS configurations. If you argument is not relevant to `imports`, consider setting {option}`defaults._module.args.` instead. + ''; }; minimal = mkOption { type = types.bool; default = false; + description = mdDoc '' + Enable to configure all [{option}`nodes`](#opt-nodes) to run with a minimal kernel. + ''; }; nodesCompat = mkOption { internal = true; + description = mdDoc '' + Basically `_module.args.nodes`, but with backcompat and warnings added. + + This will go away. + ''; }; }; diff --git a/nixos/lib/testing/run.nix b/nixos/lib/testing/run.nix index cc31914f745d..0cd07d8afd21 100644 --- a/nixos/lib/testing/run.nix +++ b/nixos/lib/testing/run.nix @@ -1,12 +1,12 @@ { config, hostPkgs, lib, ... }: let - inherit (lib) types mkOption; + inherit (lib) types mkOption mdDoc; in { options = { passthru = mkOption { type = types.lazyAttrsOf types.raw; - description = '' + description = mdDoc '' Attributes to add to the returned derivations, which are not necessarily part of the build. @@ -18,8 +18,12 @@ in test = mkOption { type = types.package; - description = '' + # TODO: can the interactive driver be configured to access the network? + description = mdDoc '' Derivation that runs the test as its "build" process. + + This implies that NixOS tests run isolated from the network, making them + more dependable. ''; }; }; diff --git a/nixos/lib/testing/testScript.nix b/nixos/lib/testing/testScript.nix index 08e87b626b3b..5d4181c5f5dd 100644 --- a/nixos/lib/testing/testScript.nix +++ b/nixos/lib/testing/testScript.nix @@ -1,12 +1,16 @@ testModuleArgs@{ config, lib, hostPkgs, nodes, moduleType, ... }: let - inherit (lib) mkOption types; + inherit (lib) mkOption types mdDoc; inherit (types) either str functionTo; in { options = { testScript = mkOption { type = either str (functionTo str); + description = '' + A series of python declarations and statements that you write to perform + the test. + ''; }; testScriptString = mkOption { type = str; @@ -21,9 +25,11 @@ in }; withoutTestScriptReferences = mkOption { type = moduleType; - description = '' + description = mdDoc '' A parallel universe where the testScript is invalid and has no references. ''; + internal = true; + visible = false; }; }; config = { From ac03757eb214edf3de5d36761ea4a3f2b0dfd370 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 27 Jun 2022 17:52:08 +0200 Subject: [PATCH 035/113] nixos/doc: Wire up the test options reference --- nixos/doc/manual/default.nix | 28 +++++++++++++++++++ .../writing-nixos-tests.section.md | 9 +++++- .../writing-nixos-tests.section.xml | 13 ++++++--- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index 5eaa44106012..ecd62eb4e848 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -38,6 +38,33 @@ let }; }; + nixos-lib = import ../../lib { }; + + testOptionsDoc = let + eval = nixos-lib.evalTest { + # Avoid evaluating a NixOS config prototype. + config.node.type = lib.types.deferredModule; + options._module.args = lib.mkOption { internal = true; }; + }; + in buildPackages.nixosOptionsDoc { + inherit (eval) options; + inherit (revision); + transformOptions = opt: opt // { + # Clean up declaration sites to not refer to the NixOS source tree. + declarations = + map + (decl: + if hasPrefix (toString ../../..) (toString decl) + then + let subpath = removePrefix "/" (removePrefix (toString ../../..) (toString decl)); + in { url = "https://github.com/NixOS/nixpkgs/blob/master/${subpath}"; name = subpath; } + else decl) + opt.declarations; + }; + documentType = "none"; + variablelistId = "test-options-list"; + }; + sources = lib.sourceFilesBySuffices ./. [".xml"]; modulesDoc = builtins.toFile "modules.xml" '' @@ -52,6 +79,7 @@ let mkdir $out ln -s ${modulesDoc} $out/modules.xml ln -s ${optionsDoc.optionsDocBook} $out/options-db.xml + ln -s ${testOptionsDoc.optionsDocBook} $out/test-options-db.xml printf "%s" "${version}" > $out/version ''; diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md index 1d8c0a2a664a..043da45d517f 100644 --- a/nixos/doc/manual/development/writing-nixos-tests.section.md +++ b/nixos/doc/manual/development/writing-nixos-tests.section.md @@ -52,7 +52,6 @@ Tests that are part of NixOS are added to [`nixos/tests/all-tests.nix`](https:// ``` Overrides can be added by defining an anonymous module in `all-tests.nix`. -For the purpose of constructing a test matrix, use the `matrix` options instead. ```nix hostname = runTest { imports = [ ./hostname.nix ]; defaults.networking.firewall.enable = false; }; @@ -476,3 +475,11 @@ added using the parameter `extraPythonPackages`. For example, you could add ``` In that case, `numpy` is chosen from the generic `python3Packages`. + +## Test Options Reference {#sec-test-options-reference} + +The following options can be used when writing tests. + +```{=docbook} + +``` diff --git a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml index 4910f0e863b5..ed6662f637fc 100644 --- a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml +++ b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml @@ -1,4 +1,4 @@ -
+
Writing Tests A NixOS test is a module that has the following structure: @@ -67,9 +67,7 @@ Overrides can be added by defining an anonymous module in - all-tests.nix. For the purpose of - constructing a test matrix, use the matrix - options instead. + all-tests.nix. hostname = runTest { imports = [ ./hostname.nix ]; defaults.networking.firewall.enable = false; }; @@ -770,4 +768,11 @@ def foo_running(): python3Packages.
+
+ Test Options Reference + + The following options can be used when writing tests. + + +
From 666e969da02e809ccd9f933e50d5759712286f8b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 27 Jun 2022 20:07:08 +0200 Subject: [PATCH 036/113] nixos/testing: Add nodes.config backcompat to nodes module argument --- nixos/lib/testing/nodes.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/lib/testing/nodes.nix b/nixos/lib/testing/nodes.nix index 624fc384c7ec..c2d4ad6e61bc 100644 --- a/nixos/lib/testing/nodes.nix +++ b/nixos/lib/testing/nodes.nix @@ -13,7 +13,7 @@ let baseModules = (import ../../modules/module-list.nix) ++ [ ./nixos-test-base.nix - { key = "nodes"; _module.args.nodes = nodes; } + { key = "nodes"; _module.args.nodes = config.nodesCompat; } ({ config, ... }: { virtualisation.qemu.package = testModuleArgs.config.qemu.package; From b2caf7965c0ba5526956ad05d340168a77fd799e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 11 Jul 2022 11:44:15 +0200 Subject: [PATCH 037/113] nixos/doc/writing-nixos-tests: Clarify working directory Co-authored-by: christian-burger --- nixos/doc/manual/development/writing-nixos-tests.section.md | 1 + .../manual/from_md/development/writing-nixos-tests.section.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md index 043da45d517f..f6f6c960b071 100644 --- a/nixos/doc/manual/development/writing-nixos-tests.section.md +++ b/nixos/doc/manual/development/writing-nixos-tests.section.md @@ -60,6 +60,7 @@ Overrides can be added by defining an anonymous module in `all-tests.nix`. You can run a test with attribute name `mytest` in `nixos/tests/all-tests.nix` by invoking: ```shell +cd /my/git/clone/of/nixpkgs nix-build -A nixosTests.mytest ``` diff --git a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml index ed6662f637fc..c5343f0a711f 100644 --- a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml +++ b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml @@ -77,6 +77,7 @@ in nixos/tests/all-tests.nix by invoking: +cd /my/git/clone/of/nixpkgs nix-build -A nixosTests.mytest
From 6a78b414768de3f8107e1eecdf79121f3ee0c8a0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 29 Jul 2022 11:50:12 +0200 Subject: [PATCH 038/113] nixos/doc/writing-nixos-tests: Various improvements Thanks to fricklerhandwerk for the many suggestions, most of which I have fixupped into preceding commits. --- .../writing-nixos-tests.section.md | 15 +++++++------ .../writing-nixos-tests.section.xml | 22 +++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md index f6f6c960b071..62da4f33d818 100644 --- a/nixos/doc/manual/development/writing-nixos-tests.section.md +++ b/nixos/doc/manual/development/writing-nixos-tests.section.md @@ -39,12 +39,10 @@ It uses two client nodes to test correct locking across server crashes. ## Calling a test {#sec-calling-nixos-tests} -Tests are invoked a bit differently depending on whether the test lives in NixOS or in another project. +Tests are invoked differently depending on whether the test is part of NixOS or lives in a different project. ### Testing within NixOS {#sec-call-nixos-test-in-nixos} -Test modules can be instantiated into derivations in multiple ways. - Tests that are part of NixOS are added to [`nixos/tests/all-tests.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/all-tests.nix). ```nix @@ -54,19 +52,22 @@ Tests that are part of NixOS are added to [`nixos/tests/all-tests.nix`](https:// Overrides can be added by defining an anonymous module in `all-tests.nix`. ```nix - hostname = runTest { imports = [ ./hostname.nix ]; defaults.networking.firewall.enable = false; }; + hostname = runTest { + imports = [ ./hostname.nix ]; + defaults.networking.firewall.enable = false; + }; ``` -You can run a test with attribute name `mytest` in `nixos/tests/all-tests.nix` by invoking: +You can run a test with attribute name `hostname` in `nixos/tests/all-tests.nix` by invoking: ```shell cd /my/git/clone/of/nixpkgs -nix-build -A nixosTests.mytest +nix-build -A nixosTests.hostname ``` ### Testing outside the NixOS project {#sec-call-nixos-test-outside-nixos} -Outside the `nixpkgs` repository, you can instantiate the test by first acquiring the NixOS library, +Outside the `nixpkgs` repository, you can instantiate the test by first importing the NixOS library, ```nix # regular nix diff --git a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml index c5343f0a711f..6e27845b598d 100644 --- a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml +++ b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml @@ -49,15 +49,11 @@
Calling a test - Tests are invoked a bit differently depending on whether the test - lives in NixOS or in another project. + Tests are invoked differently depending on whether the test is + part of NixOS or lives in a different project.
Testing within NixOS - - Test modules can be instantiated into derivations in multiple - ways. - Tests that are part of NixOS are added to nixos/tests/all-tests.nix. @@ -70,22 +66,26 @@ all-tests.nix. - hostname = runTest { imports = [ ./hostname.nix ]; defaults.networking.firewall.enable = false; }; + hostname = runTest { + imports = [ ./hostname.nix ]; + defaults.networking.firewall.enable = false; + }; - You can run a test with attribute name mytest - in nixos/tests/all-tests.nix by invoking: + You can run a test with attribute name + hostname in + nixos/tests/all-tests.nix by invoking: cd /my/git/clone/of/nixpkgs -nix-build -A nixosTests.mytest +nix-build -A nixosTests.hostname
Testing outside the NixOS project Outside the nixpkgs repository, you can - instantiate the test by first acquiring the NixOS library, + instantiate the test by first importing the NixOS library, # regular nix From 7cdc9bc34012e367522b6ac7ed98631fa95c5deb Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 19 Aug 2022 12:09:58 +0200 Subject: [PATCH 039/113] nixos/testing: Improve interactive docs --- ...nning-nixos-tests-interactively.section.md | 12 +++++++--- ...ning-nixos-tests-interactively.section.xml | 23 ++++++++++++++----- nixos/lib/testing/interactive.nix | 22 +++++++++++++++++- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/nixos/doc/manual/development/running-nixos-tests-interactively.section.md b/nixos/doc/manual/development/running-nixos-tests-interactively.section.md index 6170057442df..d9c316f4b139 100644 --- a/nixos/doc/manual/development/running-nixos-tests-interactively.section.md +++ b/nixos/doc/manual/development/running-nixos-tests-interactively.section.md @@ -38,6 +38,12 @@ directory. ## Interactive-only test configuration {#sec-nixos-test-interactive-configuration} -You can add configuration that is specific to the interactive test driver, by adding to the `interactive` option. -`interactive` is a copy of the regular test options namespace, and is used by the interactive test driver. -It can be helpful for troubleshooting changes that you don't want to apply to regular test runs. +The `.driverInteractive` attribute combines the regular test configuration with +definitions from the [`interactive` submodule](#opt-interactive). This gives you +a more usable, graphical, but slightly different configuration. + +You can add your own interactive-only test configuration by adding extra +configuration to the [`interactive` submodule](#opt-interactive). + +To interactively run only the regular configuration, build the `.driver` attribute +instead, and call it with the flag `result/bin/nixos-test-driver --interactive`. diff --git a/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml b/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml index edd3c33ff401..35d9bbd1c1fe 100644 --- a/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml +++ b/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml @@ -42,12 +42,23 @@ $ ./result/bin/nixos-test-driver --keep-vm-state
Interactive-only test configuration - You can add configuration that is specific to the interactive test - driver, by adding to the interactive option. - interactive is a copy of the regular test - options namespace, and is used by the interactive test driver. It - can be helpful for troubleshooting changes that you don’t want to - apply to regular test runs. + The .driverInteractive attribute combines the + regular test configuration with definitions from the + interactive + submodule. This gives you a more usable, graphical, but + slightly different configuration. + + + You can add your own interactive-only test configuration by adding + extra configuration to the + interactive + submodule. + + + To interactively run only the regular configuration, build the + <test>.driver attribute instead, and call + it with the flag + result/bin/nixos-test-driver --interactive.
diff --git a/nixos/lib/testing/interactive.nix b/nixos/lib/testing/interactive.nix index 43886fa72678..317ed4241882 100644 --- a/nixos/lib/testing/interactive.nix +++ b/nixos/lib/testing/interactive.nix @@ -6,11 +6,31 @@ in options = { interactive = mkOption { description = mdDoc '' - Tests [can be run interactively](#sec-running-nixos-tests-interactively). + Tests [can be run interactively](#sec-running-nixos-tests-interactively) + using the program in the test derivation's `.driverInteractive` attribute. When they are, the configuration will include anything set in this submodule. You can set any top-level test option here. + + Example test module: + + ```nix + { config, lib, ... }: { + + nodes.rabbitmq = { + services.rabbitmq.enable = true; + }; + + # When running interactively ... + interactive.nodes.rabbitmq = { + # ... enable the web ui. + services.rabbitmq.managementPlugin.enable = true; + }; + } + ``` + + For details, see the section about [running tests interactively](#sec-running-nixos-tests-interactively). ''; type = moduleType; visible = "shallow"; From 1c0b9c4a482b745040be828eafa8bb6b4e3b2200 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 17 Sep 2022 14:34:14 +0100 Subject: [PATCH 040/113] nixos/testing/network.nix: Add network config to specialisations --- nixos/lib/testing/network.nix | 2 +- nixos/lib/testing/nodes.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/lib/testing/network.nix b/nixos/lib/testing/network.nix index 513ec7a14092..04ea9a2bc9f7 100644 --- a/nixos/lib/testing/network.nix +++ b/nixos/lib/testing/network.nix @@ -112,6 +112,6 @@ let in { config = { - defaults = { imports = [ networkModule nodeNumberModule ]; }; + extraBaseModules = { imports = [ networkModule nodeNumberModule ]; }; }; } diff --git a/nixos/lib/testing/nodes.nix b/nixos/lib/testing/nodes.nix index c2d4ad6e61bc..765af2878dfe 100644 --- a/nixos/lib/testing/nodes.nix +++ b/nixos/lib/testing/nodes.nix @@ -22,6 +22,7 @@ let # when the test framework is used by Nixpkgs NixOS tests. nixpkgs.config.allowAliases = false; }) + testModuleArgs.config.extraBaseModules ] ++ optional config.minimal ../../modules/testing/minimal-kernel.nix; }; From f40ff7f1f12b49ca1aa5c9a0e3bad6cfdcf3ccaa Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 18 Sep 2022 12:59:14 +0100 Subject: [PATCH 041/113] nixos/tests/installer: Add make-options-doc dep --- nixos/tests/installer.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index 9e2eca8daa3a..d9f64a781c57 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -336,7 +336,13 @@ let perlPackages.ListCompare perlPackages.XMLLibXML python3Minimal - python3Packages.mistune + # make-options-doc/default.nix + (let + self = (pkgs.python3Minimal.override { + inherit self; + includeSiteCustomize = true; + }); + in self.withPackages (p: [ p.mistune ])) shared-mime-info sudo texinfo From 3ce4179374352b1407b1800cb97c1e08a07db4ca Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 24 Sep 2022 17:32:56 +0100 Subject: [PATCH 042/113] nixos/doc/writing-nixos-tests: Remove flake info for now --- .../development/writing-nixos-tests.section.md | 11 ----------- .../development/writing-nixos-tests.section.xml | 12 +----------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md index 62da4f33d818..99704ec3c141 100644 --- a/nixos/doc/manual/development/writing-nixos-tests.section.md +++ b/nixos/doc/manual/development/writing-nixos-tests.section.md @@ -70,20 +70,9 @@ nix-build -A nixosTests.hostname Outside the `nixpkgs` repository, you can instantiate the test by first importing the NixOS library, ```nix -# regular nix let nixos-lib = import (nixpkgs + "/nixos/lib") { }; in -``` -```nix -# flake -let nixos-lib = nixpkgs.lib.nixos; -in -``` - -... and then invoking `runTest`, for example: - -```nix nixos-lib.runTest { imports = [ ./test.nix ]; hostPkgs = pkgs; # the Nixpkgs package set used outside the VMs diff --git a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml index 6e27845b598d..32f5fdb77f50 100644 --- a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml +++ b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml @@ -88,19 +88,9 @@ nix-build -A nixosTests.hostname instantiate the test by first importing the NixOS library, -# regular nix let nixos-lib = import (nixpkgs + "/nixos/lib") { }; in - - -# flake -let nixos-lib = nixpkgs.lib.nixos; -in - - - … and then invoking runTest, for example: - - + nixos-lib.runTest { imports = [ ./test.nix ]; hostPkgs = pkgs; # the Nixpkgs package set used outside the VMs From 608a3ef0b71359fb19ecfaaa3c8163dc58058010 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 25 Sep 2022 17:54:23 +0200 Subject: [PATCH 043/113] gscan2pdf: 2.12.6 -> 2.12.8 Adds a patch that fixes ffmpeg 5.1 compatibility --- pkgs/applications/graphics/gscan2pdf/default.nix | 8 ++++++-- .../graphics/gscan2pdf/ffmpeg5-compat.patch | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/graphics/gscan2pdf/ffmpeg5-compat.patch diff --git a/pkgs/applications/graphics/gscan2pdf/default.nix b/pkgs/applications/graphics/gscan2pdf/default.nix index 214688b56f89..fc686ad1f212 100644 --- a/pkgs/applications/graphics/gscan2pdf/default.nix +++ b/pkgs/applications/graphics/gscan2pdf/default.nix @@ -10,13 +10,17 @@ with lib; perlPackages.buildPerlPackage rec { pname = "gscan2pdf"; - version = "2.12.6"; + version = "2.12.8"; src = fetchurl { url = "mirror://sourceforge/gscan2pdf/gscan2pdf-${version}.tar.xz"; - sha256 = "sha256-9ntpUEM3buT3EhneXz9G8bibvzOnEK6Xt0jJcTvLKT0="; + hash = "sha256-dmN2fMBDZqgvdHQryQgjmBHeH/h2dihRH8LkflFYzTk="; }; + patches = [ + ./ffmpeg5-compat.patch + ]; + nativeBuildInputs = [ wrapGAppsHook ]; buildInputs = diff --git a/pkgs/applications/graphics/gscan2pdf/ffmpeg5-compat.patch b/pkgs/applications/graphics/gscan2pdf/ffmpeg5-compat.patch new file mode 100644 index 000000000000..ff522735fe35 --- /dev/null +++ b/pkgs/applications/graphics/gscan2pdf/ffmpeg5-compat.patch @@ -0,0 +1,15 @@ +--- a/t/351_unpaper.t ++++ b/t/351_unpaper.t +@@ -88,8 +88,10 @@ + + # if we use unlike, we no longer + # know how many tests there will be +- if ( $msg !~ +-/(deprecated|Encoder did not produce proper pts, making some up)/ ++ if ( $msg !~ /( deprecated | ++ \Qdoes not contain an image sequence pattern\E | ++ \QEncoder did not produce proper pts, making some up\E | ++ \Quse the -update option\E )/x + ) + { + fail 'no warnings'; From 7f8e423fd0537aff741e45ae5a3768b5fb87a150 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 25 Sep 2022 23:40:10 +0200 Subject: [PATCH 044/113] python310Packages.testcontainers: 3.5.0 -> 3.7.0 --- pkgs/development/python-modules/testcontainers/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/testcontainers/default.nix b/pkgs/development/python-modules/testcontainers/default.nix index 65c8ed8bf460..20c52fd686a0 100644 --- a/pkgs/development/python-modules/testcontainers/default.nix +++ b/pkgs/development/python-modules/testcontainers/default.nix @@ -7,13 +7,13 @@ buildPythonPackage rec { pname = "testcontainers"; - version = "3.5.0"; + version = "3.7.0"; src = fetchFromGitHub { owner = "testcontainers"; repo = "testcontainers-python"; rev = "v${version}"; - sha256 = "sha256-uB3MbRVQzbUdZRxkGl635O+K17bkHIGY2JbU8R23Kt0="; + sha256 = "sha256-t6W5A877bSPcbKVzCLEhjPzOPwF8ZTGjlvnwt1CwWCE="; }; buildInputs = [ From 32976e0eabce085fe4cbb018728348bf2864b697 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 Sep 2022 07:23:08 +0000 Subject: [PATCH 045/113] gensio: 2.3.7 -> 2.5.5 --- pkgs/development/libraries/gensio/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gensio/default.nix b/pkgs/development/libraries/gensio/default.nix index 48e2d4fd8fb3..2ae3d8d93b03 100644 --- a/pkgs/development/libraries/gensio/default.nix +++ b/pkgs/development/libraries/gensio/default.nix @@ -8,13 +8,13 @@ stdenv.mkDerivation rec { pname = "gensio"; - version = "2.3.7"; + version = "2.5.5"; src = fetchFromGitHub { owner = "cminyard"; repo = pname; rev = "v${version}"; - sha256 = "sha256-g1o/udsIFLJ+gunvI2QtsnksPaa946jWKkcdmdGmQ/k="; + sha256 = "sha256-K2A61OflKdVVzdV8qH5x/ggZKa4i8yvs5bdPoOwmm7A="; }; passthru = { From b59be74f0e9a72cc241ac215efce63b03075c924 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 26 Sep 2022 10:08:11 +0200 Subject: [PATCH 046/113] python310Packages.hass-nabucasa: 0.55.0 -> 0.56.0 --- pkgs/development/python-modules/hass-nabucasa/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/hass-nabucasa/default.nix b/pkgs/development/python-modules/hass-nabucasa/default.nix index ce2f12804bd8..c6b17872ea8d 100644 --- a/pkgs/development/python-modules/hass-nabucasa/default.nix +++ b/pkgs/development/python-modules/hass-nabucasa/default.nix @@ -15,13 +15,13 @@ buildPythonPackage rec { pname = "hass-nabucasa"; - version = "0.55.0"; + version = "0.56.0"; src = fetchFromGitHub { owner = "nabucasa"; repo = pname; rev = version; - sha256 = "sha256-3r955nZu/nNHnFQJy8bSswtd4N0JxGZA8RLU0CXZT7o="; + sha256 = "sha256-IgDOugHr4fCD9o3QQY5w/ibjak/d56R31KgQAbjUkkI="; }; postPatch = '' From c1607ac82b17a2441fb2b8c0814e172fb8fafe95 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 Sep 2022 22:31:59 +0000 Subject: [PATCH 047/113] pixelorama: 0.10.2 -> 0.10.3 --- pkgs/applications/editors/pixelorama/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/pixelorama/default.nix b/pkgs/applications/editors/pixelorama/default.nix index 4c95a93a1405..20dcd766b17e 100644 --- a/pkgs/applications/editors/pixelorama/default.nix +++ b/pkgs/applications/editors/pixelorama/default.nix @@ -9,13 +9,13 @@ let else throw "unsupported platform"; in stdenv.mkDerivation rec { pname = "pixelorama"; - version = "0.10.2"; + version = "0.10.3"; src = fetchFromGitHub { owner = "Orama-Interactive"; repo = "Pixelorama"; rev = "v${version}"; - sha256 = "sha256-IqOBZGo0M8JfREpCv14AvRub6yVTpKfAd5JCNqCVolQ="; + sha256 = "sha256-RFE7K8NMl0COzFEhUqWhhYd5MGBsCDJf0T5daPu/4DI="; }; nativeBuildInputs = [ From 643c82b0140984a002414da5a1ef87ac25ae3870 Mon Sep 17 00:00:00 2001 From: pkharvey Date: Mon, 26 Sep 2022 23:49:58 +0100 Subject: [PATCH 048/113] stm8flash: init at 2022-03-27 --- .../embedded/stm8/stm8flash/default.nix | 34 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/embedded/stm8/stm8flash/default.nix diff --git a/pkgs/development/embedded/stm8/stm8flash/default.nix b/pkgs/development/embedded/stm8/stm8flash/default.nix new file mode 100644 index 000000000000..eaf1a19c91bc --- /dev/null +++ b/pkgs/development/embedded/stm8/stm8flash/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub, libusb1, pkg-config }: + +stdenv.mkDerivation rec { + pname = "stm8flash"; + version = "2022-03-27"; + + src = fetchFromGitHub { + owner = "vdudouyt"; + repo = "stm8flash"; + rev = "23305ce5adbb509c5cb668df31b0fd6c8759639c"; + sha256 = "sha256-fFoC2EKSmYyW2lqrdAh5A2WEtUMCenKse2ySJdNHu6w="; + }; + + strictDeps = true; + enableParallelBuilding = true; + + # NOTE: _FORTIFY_SOURCE requires compiling with optimization (-O) + NIX_CFLAGS_COMPILE = "-O"; + + preBuild = '' + export DESTDIR=$out; + ''; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ libusb1 ]; + + meta = with lib; { + homepage = "https://github.com/vdudouyt/stm8flash"; + description = "A tool for flashing STM8 MCUs via ST-LINK (V1 and V2)"; + maintainers = with maintainers; [ pkharvey ]; + license = licenses.gpl2; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b7297191de4..63cd17e58ebc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17361,6 +17361,8 @@ with pkgs; stm32flash = callPackage ../development/embedded/stm32/stm32flash { }; + stm8flash = callPackage ../development/embedded/stm8/stm8flash { }; + strace = callPackage ../development/tools/misc/strace { }; stylua = callPackage ../development/tools/stylua { }; From 1bc09e202ea15719d10ac11b02da13d044b32dc1 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 Sep 2022 23:12:41 +0000 Subject: [PATCH 049/113] radarr: 4.1.0.6175 -> 4.2.4.6635 --- pkgs/servers/radarr/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/radarr/default.nix b/pkgs/servers/radarr/default.nix index ceb6d270d13a..9f5541adff45 100644 --- a/pkgs/servers/radarr/default.nix +++ b/pkgs/servers/radarr/default.nix @@ -9,14 +9,14 @@ let }."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); hash = { - x64-linux_hash = "sha256-3oxCBg+lxN8eGaS1kmIK0kL2qUNOLHhLnkMPmPlZcyw="; - arm64-linux_hash = "sha256-OaCI2neL8bMFf/QuZEZXKuZgJBnUT+Q2XMChfSqF5Bc="; - x64-osx_hash = "sha256-vv3ds5BE2PDA94Hkr//MB0a7CF3dnk7r7wYF9SAzL48="; + x64-linux_hash = "sha256-kdY0RiZWrPCaXDGWhnJY2jGOO9h0WNRnT+CQ11l4How="; + arm64-linux_hash = "sha256-gG7r4G6iHLZPkjR43uD6s3b3mitTT2yfGxYdwPlI8D0="; + x64-osx_hash = "sha256-guqmzEMRytN2IJ907KW+rZq9cHT6oC3GyHzTyVyFU0w="; }."${arch}-${os}_hash"; in stdenv.mkDerivation rec { pname = "radarr"; - version = "4.1.0.6175"; + version = "4.2.4.6635"; src = fetchurl { url = "https://github.com/Radarr/Radarr/releases/download/v${version}/Radarr.master.${version}.${os}-core-${arch}.tar.gz"; From 22927943807e817b9eaa5360236056ad3a01584e Mon Sep 17 00:00:00 2001 From: figsoda Date: Mon, 26 Sep 2022 18:58:50 -0400 Subject: [PATCH 050/113] asciinema-agg: init at 1.3.0 --- pkgs/tools/misc/asciinema-agg/default.nix | 26 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/tools/misc/asciinema-agg/default.nix diff --git a/pkgs/tools/misc/asciinema-agg/default.nix b/pkgs/tools/misc/asciinema-agg/default.nix new file mode 100644 index 000000000000..685afc2d66a4 --- /dev/null +++ b/pkgs/tools/misc/asciinema-agg/default.nix @@ -0,0 +1,26 @@ +{ lib, rustPlatform, fetchFromGitHub, stdenv, Security }: + +rustPlatform.buildRustPackage rec { + pname = "agg"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "asciinema"; + repo = pname; + rev = "v${version}"; + sha256 = "15j7smkjv2z9vd7drdq83g40j986ny39ai6y9rnai3iljsycyvgs"; + }; + + cargoSha256 = "sha256-ORSYIRcvnKFkJxEjiTUSa1gkfmiQs3EAVOpXePVgBPQ="; + + buildInputs = lib.optionals stdenv.isDarwin [ + Security + ]; + + meta = with lib; { + description = "A command-line tool for generating animated GIF files from asciicast v2 files produced by asciinema terminal recorder"; + homepage = "https://github.com/asciinema/agg"; + license = licenses.asl20; + maintainers = with maintainers; [ figsoda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b7297191de4..accdfb01e043 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2088,6 +2088,10 @@ with pkgs; asciinema = callPackage ../tools/misc/asciinema {}; + asciinema-agg = callPackage ../tools/misc/asciinema-agg { + inherit (darwin.apple_sdk.frameworks) Security; + }; + asciinema-scenario = callPackage ../tools/misc/asciinema-scenario {}; asciiquarium = callPackage ../applications/misc/asciiquarium {}; From 6671b3a9503d883db9a8b9cfb90ce75dd806680d Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 Sep 2022 23:39:09 +0000 Subject: [PATCH 051/113] python310Packages.hmmlearn: 0.2.7 -> 0.2.8 --- pkgs/development/python-modules/hmmlearn/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/hmmlearn/default.nix b/pkgs/development/python-modules/hmmlearn/default.nix index 8c699af97526..153c582b7cf0 100644 --- a/pkgs/development/python-modules/hmmlearn/default.nix +++ b/pkgs/development/python-modules/hmmlearn/default.nix @@ -4,11 +4,11 @@ buildPythonPackage rec { pname = "hmmlearn"; - version = "0.2.7"; + version = "0.2.8"; src = fetchurl { url = "mirror://pypi/h/hmmlearn/${pname}-${version}.tar.gz"; - sha256 = "sha256-a0snIPJ6912pNnq02Q3LAPONozFo322Rf57F3mZw9uE="; + sha256 = "sha256-aWkx49zmgBzJt4xin1QwYd1+tnpxFVsD0bOeoXKipfk="; }; buildInputs = [ setuptools-scm cython pybind11 ]; From e628b43a9c2aff685e420028b58a4376e3117c8a Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 24 Sep 2022 14:52:38 +0200 Subject: [PATCH 052/113] common-updater-scripts: fix silent error on 404 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When TOFU was unable to download the file, there would be no hash in the fetch log, causing the grep to fail. Since the script is set to errexit, it would terminate the processing without any output. Let’s instead print the fetch log. --- pkgs/common-updater/scripts/update-source-version | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/common-updater/scripts/update-source-version b/pkgs/common-updater/scripts/update-source-version index 12a63fa92605..75ad6e7a5cf5 100755 --- a/pkgs/common-updater/scripts/update-source-version +++ b/pkgs/common-updater/scripts/update-source-version @@ -237,9 +237,13 @@ fi if [[ -z "$newHash" ]]; then nix-build $systemArg --no-out-link -A "$attr.$sourceKey" 2>"$attr.fetchlog" >/dev/null || true # FIXME: use nix-build --hash here once https://github.com/NixOS/nix/issues/1172 is fixed - newHash=$(sed '1,/hash mismatch in fixed-output derivation/d' "$attr.fetchlog" | grep --perl-regexp --only-matching 'got: +.+[:-]\K.+') + newHash=$( + sed '1,/hash mismatch in fixed-output derivation/d' "$attr.fetchlog" \ + | grep --perl-regexp --only-matching 'got: +.+[:-]\K.+' \ + || true # handled below + ) - if [[ -n "$sri" ]]; then + if [[ -n "$newHash" && -n "$sri" ]]; then # nix-build preserves the hashing scheme so we can just convert the result to SRI using the old type newHash="$(nix --extra-experimental-features nix-command hash to-sri --type "$oldHashAlgo" "$newHash" 2>/dev/null \ || nix to-sri --type "$oldHashAlgo" "$newHash" 2>/dev/null)" \ From a5af361af4d6cda34611bde73e51e1d7bb438827 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 24 Sep 2022 14:58:58 +0200 Subject: [PATCH 053/113] gnome.updateScript: Support freezing up to an explicit version libgweather released version 4 after releasing version 40, we need to ignore the latter. --- pkgs/desktops/gnome/update.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/desktops/gnome/update.nix b/pkgs/desktops/gnome/update.nix index f5db71174ad8..e945e005d48d 100644 --- a/pkgs/desktops/gnome/update.nix +++ b/pkgs/desktops/gnome/update.nix @@ -12,7 +12,13 @@ let minorAvailable = builtins.length versionComponents > 1 && builtins.match "[0-9]+" minorVersion != null; nextMinor = builtins.fromJSON minorVersion + 1; upperBound = "${lib.versions.major packageVersion}.${builtins.toString nextMinor}"; - in lib.optionals (freeze && minorAvailable) [ upperBound ]; + in + if builtins.isBool freeze then + lib.optionals (freeze && minorAvailable) [ upperBound ] + else if builtins.isString freeze then + [ freeze ] + else + throw "“freeze” argument needs to be either a boolean, or a version string."; updateScript = writeScript "gnome-update-script" '' #!${bash}/bin/bash set -o errexit From 34d4ea2781a4d70aa71b6768280c2bf6af081953 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 27 Sep 2022 02:13:47 +0200 Subject: [PATCH 054/113] libgweather: Fix update script downloading wrong version Previous maintainer released version 40 but the current maintainer decided that it was a bad idea and continued with version 4. This was confusing our update script. --- pkgs/development/libraries/libgweather/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/libgweather/default.nix b/pkgs/development/libraries/libgweather/default.nix index cae2095f8ebd..bc9a04685840 100644 --- a/pkgs/development/libraries/libgweather/default.nix +++ b/pkgs/development/libraries/libgweather/default.nix @@ -74,6 +74,8 @@ stdenv.mkDerivation rec { updateScript = gnome.updateScript { packageName = pname; versionPolicy = "odd-unstable"; + # Version 40.alpha preceded version 4.0. + freeze = "40.alpha"; }; }; From d019199454513e78700afb50e1f9312d4aca4706 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 00:30:34 +0000 Subject: [PATCH 055/113] python310Packages.jellyfin-apiclient-python: 1.9.1 -> 1.9.2 --- .../python-modules/jellyfin-apiclient-python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/jellyfin-apiclient-python/default.nix b/pkgs/development/python-modules/jellyfin-apiclient-python/default.nix index be848b652827..4413f081a635 100644 --- a/pkgs/development/python-modules/jellyfin-apiclient-python/default.nix +++ b/pkgs/development/python-modules/jellyfin-apiclient-python/default.nix @@ -10,14 +10,14 @@ buildPythonPackage rec { pname = "jellyfin-apiclient-python"; - version = "1.9.1"; + version = "1.9.2"; format = "setuptools"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - hash = "sha256-fS+NQUTKNxHuE+qsV91mpTlYt7DfXQVsA9ybfLlHYtc="; + hash = "sha256-vMzZeoiWli3HjM8Dqr5RhNfR7gcjPqoXG3b/aNNlx2Q="; }; propagatedBuildInputs = [ From 6dc5f10d8085caa13c992dcc9e5e2296ea5fcf3b Mon Sep 17 00:00:00 2001 From: Yaya Date: Tue, 27 Sep 2022 07:51:48 +0000 Subject: [PATCH 056/113] snowflake: 2.3.0 -> 2.3.1 https://gitweb.torproject.org/pluggable-transports/snowflake.git/plain/ChangeLog --- pkgs/tools/networking/snowflake/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/snowflake/default.nix b/pkgs/tools/networking/snowflake/default.nix index 5f42f9125486..5118186c4de2 100644 --- a/pkgs/tools/networking/snowflake/default.nix +++ b/pkgs/tools/networking/snowflake/default.nix @@ -2,12 +2,12 @@ buildGoModule rec { pname = "snowflake"; - version = "2.3.0"; + version = "2.3.1"; src = fetchgit { url = "https://git.torproject.org/pluggable-transports/${pname}"; rev = "v${version}"; - sha256 = "sha256-LQ9QIdj3id6bEzAItMGc3pJFylNP4har79VKUa9qo20="; + sha256 = "sha256-4/ZTLyST73krOL87am28TM+1mktchpoCSaASMqQl5e8="; }; vendorSha256 = "sha256-a2Ng+D1I0v5odChM6XVVnNwea/0SOTOmdm2dqKaSU3s="; From ddf9f1800a8f6ed321646026ee9c795c90a8b993 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 11:26:09 +0000 Subject: [PATCH 057/113] delly: 1.1.3 -> 1.1.5 --- pkgs/applications/science/biology/delly/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/biology/delly/default.nix b/pkgs/applications/science/biology/delly/default.nix index ee4a8f299444..f758e4116794 100644 --- a/pkgs/applications/science/biology/delly/default.nix +++ b/pkgs/applications/science/biology/delly/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "delly"; - version = "1.1.3"; + version = "1.1.5"; src = fetchFromGitHub { owner = "dellytools"; repo = pname; rev = "v${version}"; - sha256 = "sha256-fGwSRYpvGYyYvRvP1ljs3mhXRpONzO5/QVegjqMsOdk="; + sha256 = "sha256-K75tpbW1h84gzZ+s5jMzmFItfBi6rjkAhzks9F0gYpA="; }; buildInputs = [ zlib htslib bzip2 xz ncurses boost ]; From f1abf12a042bfb0ded32ccebbe2b3634014311da Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 12:30:34 +0000 Subject: [PATCH 058/113] pg_activity: 3.0.0 -> 3.0.1 --- pkgs/development/tools/database/pg_activity/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/database/pg_activity/default.nix b/pkgs/development/tools/database/pg_activity/default.nix index f7e034a9a77c..399c8801f772 100644 --- a/pkgs/development/tools/database/pg_activity/default.nix +++ b/pkgs/development/tools/database/pg_activity/default.nix @@ -2,14 +2,14 @@ python3Packages.buildPythonApplication rec { pname = "pg_activity"; - version = "3.0.0"; + version = "3.0.1"; disabled = python3Packages.pythonOlder "3.6"; src = fetchFromGitHub { owner = "dalibo"; repo = pname; rev = "refs/tags/v${version}"; - sha256 = "sha256-MJZS5+i3s5fTFcgw5zt3GeJKKZ/GS66scuUAW9Fu73A="; + sha256 = "sha256-YsHY2Hvr1aDKA+YOftc7iUi1qXDv6HW+jQtTQgQ5+M4="; }; propagatedBuildInputs = with python3Packages; [ From 13943e2b68027819051996dfef46619a671aaae7 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 12:54:23 +0000 Subject: [PATCH 059/113] geoipupdate: 4.9.0 -> 4.10.0 --- pkgs/applications/misc/geoipupdate/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/geoipupdate/default.nix b/pkgs/applications/misc/geoipupdate/default.nix index 26d729fe8a79..c2f025d20ae1 100644 --- a/pkgs/applications/misc/geoipupdate/default.nix +++ b/pkgs/applications/misc/geoipupdate/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "geoipupdate"; - version = "4.9.0"; + version = "4.10.0"; src = fetchFromGitHub { owner = "maxmind"; repo = "geoipupdate"; rev = "v${version}"; - sha256 = "sha256-AqA0hzZGn5XU2Pyoj1vaP+ht7r3dpDhuang4KCXaSgs="; + sha256 = "sha256-Djr0IjRxf4kKOsL0KMTAkRjW/zo0+r63TBCjet2ZhNw="; }; - vendorSha256 = "sha256-S+CnIPoyGM7dEQICOIlAWBIC24Fyt7q+OY382evDgQc="; + vendorSha256 = "sha256-upyblOmT1UC1epOI5H92G/nzcCuGNyh3dbIApUg2Idk="; ldflags = [ "-X main.version=${version}" ]; From f57b8bd640d676598c0eb0b6ea35b7c26e15e10e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 27 Sep 2022 19:51:37 +0200 Subject: [PATCH 060/113] cloudfox: init at 1.7.1 --- pkgs/tools/security/cloudfox/default.nix | 28 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/tools/security/cloudfox/default.nix diff --git a/pkgs/tools/security/cloudfox/default.nix b/pkgs/tools/security/cloudfox/default.nix new file mode 100644 index 000000000000..b4781ba7c0bd --- /dev/null +++ b/pkgs/tools/security/cloudfox/default.nix @@ -0,0 +1,28 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "cloudfox"; + version = "1.7.1"; + + src = fetchFromGitHub { + owner = "BishopFox"; + repo = pname; + rev = "v${version}"; + hash = "sha256-JwSXm75CC1GBbQ7kZJXyDXf2997owRaGcB2m7q+BrEs="; + }; + + vendorSha256 = "sha256-KrJR5YZxP6psHphY0BhYFu14PaDi5k1ngFfYPSzOYK4="; + + # Some tests are failing because of wrong filename/path + doCheck = false; + + meta = with lib; { + description = "Tool for situational awareness of cloud penetration tests"; + homepage = "https://github.com/BishopFox/cloudfox"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 119702effa3d..1f51daa6e5c1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2362,6 +2362,8 @@ with pkgs; cloud-sql-proxy = callPackage ../tools/misc/cloud-sql-proxy { }; + cloudfox = callPackage ../tools/security/cloudfox { }; + cloudsmith-cli = callPackage ../development/tools/cloudsmith-cli { }; codeql = callPackage ../development/tools/analysis/codeql { }; From d6a24e574c74d8b57fc1cb267f1650c60e993493 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 02:01:51 +0200 Subject: [PATCH 061/113] cpuid: 20220812 -> 20220927 --- pkgs/os-specific/linux/cpuid/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/cpuid/default.nix b/pkgs/os-specific/linux/cpuid/default.nix index abe6f44f31a9..73e38d885e7c 100644 --- a/pkgs/os-specific/linux/cpuid/default.nix +++ b/pkgs/os-specific/linux/cpuid/default.nix @@ -6,11 +6,11 @@ stdenv.mkDerivation rec { pname = "cpuid"; - version = "20220812"; + version = "20220927"; src = fetchurl { url = "http://etallen.com/cpuid/${pname}-${version}.src.tar.gz"; - sha256 = "sha256-O/aPuX2UcU+QdjzK2BDfjcX3/pwfmjZSQ2SR/XVBWr8="; + sha256 = "sha256-sykaiTRIJgKGgaIoBgUpIMDzSY0Jn/3OP2P1Z6HqQOw="; }; # For pod2man during the build process. From 11c921f51aedd95ccbc3412e37d3ac6ea9d90e4a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 00:18:46 +0000 Subject: [PATCH 062/113] python310Packages.iminuit: 2.16.0 -> 2.17.0 --- pkgs/development/python-modules/iminuit/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/iminuit/default.nix b/pkgs/development/python-modules/iminuit/default.nix index 246f04618f2d..19c38ac3fbc8 100644 --- a/pkgs/development/python-modules/iminuit/default.nix +++ b/pkgs/development/python-modules/iminuit/default.nix @@ -9,14 +9,14 @@ buildPythonPackage rec { pname = "iminuit"; - version = "2.16.0"; + version = "2.17.0"; format = "setuptools"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - hash = "sha256-ECSlGdvI/VLV/So3ef1IWwm8J8QFVt74tvkWlUIxmdY="; + hash = "sha256-dfSoorrSH9p7a9Qt98oEEg+yRjbr+bVm0lmybyBEsdA="; }; nativeBuildInputs = [ From 8407d056ca5a5e5ea651a39d06bc053c44795505 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 17:25:49 +0000 Subject: [PATCH 063/113] netbird: 0.9.4 -> 0.9.6 --- pkgs/tools/networking/netbird/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/netbird/default.nix b/pkgs/tools/networking/netbird/default.nix index 902b33e70e9e..f9bff389805e 100644 --- a/pkgs/tools/networking/netbird/default.nix +++ b/pkgs/tools/networking/netbird/default.nix @@ -14,13 +14,13 @@ let in buildGoModule rec { pname = "netbird"; - version = "0.9.4"; + version = "0.9.6"; src = fetchFromGitHub { owner = "netbirdio"; repo = pname; rev = "v${version}"; - sha256 = "sha256-x5TJChvpeiAPye9YkIMJYumvCUHULUVjC371ZoaHkUM="; + sha256 = "sha256-VNKVl1C14iZROl3JFHY7+8EYbgZTuoz5rVOOBqkmmo0="; }; vendorSha256 = "sha256-VyYw8Hp2qWoRBeOFsgtxmvFN2cYzuDeYmWAwC/+vjI0="; From 0ede411efe3e195580aa199e045d7c7d4e790e8d Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 15 Sep 2022 15:33:23 +0000 Subject: [PATCH 064/113] cubiomes-viewer: 2.3.3 -> 2.4.1 --- pkgs/applications/misc/cubiomes-viewer/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/cubiomes-viewer/default.nix b/pkgs/applications/misc/cubiomes-viewer/default.nix index 19dac91c3079..2243a8d09375 100644 --- a/pkgs/applications/misc/cubiomes-viewer/default.nix +++ b/pkgs/applications/misc/cubiomes-viewer/default.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation rec { pname = "cubiomes-viewer"; - version = "2.3.3"; + version = "2.4.1"; src = fetchFromGitHub { owner = "Cubitect"; repo = pname; rev = version; - sha256 = "sha256-QNNKfL2pLdOqbjd6t7SLaLcHmyEmmB7vFvj1g6FSTBo="; + sha256 = "sha256-vneX3Wo1DUK1WIwBP3nMUDV26EN2A7XIqMcTZQ4UI4A="; fetchSubmodules = true; }; From 46e368bf54238b88c95e2ffa84074f816037da9f Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 24 Sep 2022 09:37:49 +0000 Subject: [PATCH 065/113] bloat: unstable-2022-05-10 -> unstable-2022-09-23 --- pkgs/servers/bloat/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/bloat/default.nix b/pkgs/servers/bloat/default.nix index 2d0dbde74d52..f9239dbb1802 100644 --- a/pkgs/servers/bloat/default.nix +++ b/pkgs/servers/bloat/default.nix @@ -6,12 +6,12 @@ buildGoModule { pname = "bloat"; - version = "unstable-2022-05-10"; + version = "unstable-2022-09-23"; src = fetchgit { url = "git://git.freesoftwareextremist.com/bloat"; - rev = "1661219ab6e3c12b29d676d57ce452feb81d0dd9"; - sha256 = "sha256-Vb0WTRYPv0+g0by+h09sDDMVCjRYF28PwbXJNkdX6NA="; + rev = "68698a9e1afce43ef807d6b5f892ca1c0f905b8a"; + sha256 = "sha256-gxSHxMdiIWsJb/qM3W7Eon/ST15l2wkJqyjxEU8RlCQ="; }; vendorSha256 = null; From 2616f6b7c60a3536cdb03c5e4cb8717aceda536f Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 17:04:00 +0000 Subject: [PATCH 066/113] mold: 1.4.2 -> 1.5.0 --- pkgs/development/tools/mold/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/mold/default.nix b/pkgs/development/tools/mold/default.nix index 1d4a64d4467e..d23a3790f122 100644 --- a/pkgs/development/tools/mold/default.nix +++ b/pkgs/development/tools/mold/default.nix @@ -12,13 +12,13 @@ stdenv.mkDerivation rec { pname = "mold"; - version = "1.4.2"; + version = "1.5.0"; src = fetchFromGitHub { owner = "rui314"; repo = pname; rev = "v${version}"; - hash = "sha256-omi4vx8KDpgZ/y3MvE5c/9MxSLXIA4IHJAMue3XpfD8="; + hash = "sha256-mCuKNVWjll9+xYPR6DnwkzPxbn4gR+x+DaCCTI9BXiE="; }; nativeBuildInputs = [ cmake ninja ]; From 0e4ae15b65ba24be412021f6bab1b77a71e3fe97 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 14:49:44 +0000 Subject: [PATCH 067/113] kyverno: 1.7.3 -> 1.7.4 --- pkgs/applications/networking/cluster/kyverno/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/cluster/kyverno/default.nix b/pkgs/applications/networking/cluster/kyverno/default.nix index f240550d115a..d00b1b38b2ee 100644 --- a/pkgs/applications/networking/cluster/kyverno/default.nix +++ b/pkgs/applications/networking/cluster/kyverno/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "kyverno"; - version = "1.7.3"; + version = "1.7.4"; src = fetchFromGitHub { owner = "kyverno"; repo = "kyverno"; rev = "v${version}"; - sha256 = "sha256-lxfDbsBldMuF++Bb7rXsz+etLC78nTmWAaGbs6mcnBo="; + sha256 = "sha256-EzPd4D+pK9mFSoJx9gEWEw9izXum2NgACiBuQ6uTYGo="; }; ldflags = [ From bacda55ef60bcd8888cfe704c96209683edb8aa9 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 16:28:49 +0000 Subject: [PATCH 068/113] minigalaxy: 1.2.1 -> 1.2.2 --- pkgs/applications/misc/minigalaxy/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/minigalaxy/default.nix b/pkgs/applications/misc/minigalaxy/default.nix index 6604368b7d79..c33e0d6a576c 100644 --- a/pkgs/applications/misc/minigalaxy/default.nix +++ b/pkgs/applications/misc/minigalaxy/default.nix @@ -16,13 +16,13 @@ python3Packages.buildPythonApplication rec { pname = "minigalaxy"; - version = "1.2.1"; + version = "1.2.2"; src = fetchFromGitHub { owner = "sharkwouter"; repo = pname; rev = "refs/tags/${version}"; - sha256 = "sha256-KTbur9UhV08Wy3Eg/UboG0fZ/6nzNABAildnhe64FEs="; + sha256 = "sha256-bpNtdMYBl2dJ4PQsxkhm/Y+3A0dD/Y2XC0VaUYyRhvM="; }; checkPhase = '' From 97116b9f7cf954e2a1556471530d3d571a7f3528 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 13:13:52 +0000 Subject: [PATCH 069/113] pyradio: 0.8.9.27 -> 0.8.9.28 --- pkgs/applications/audio/pyradio/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/pyradio/default.nix b/pkgs/applications/audio/pyradio/default.nix index ba9320037e46..ef31c2a6ee99 100644 --- a/pkgs/applications/audio/pyradio/default.nix +++ b/pkgs/applications/audio/pyradio/default.nix @@ -2,13 +2,13 @@ python3Packages.buildPythonApplication rec { pname = "pyradio"; - version = "0.8.9.27"; + version = "0.8.9.28"; src = fetchFromGitHub { owner = "coderholic"; repo = pname; rev = "refs/tags/${version}"; - sha256 = "sha256-KqSpyDiRhp7DdbFsPor+munMQg+0vv0qF2VI3gkR04Y="; + sha256 = "sha256-0j0AQZk+WEkcRTL/peAxzRw23gThlGtMnqoms2aUCrc="; }; nativeBuildInputs = [ installShellFiles ]; From bae1cc020796bf318cb03f8f6628d49033087af0 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 09:28:43 +0000 Subject: [PATCH 070/113] boulder: 2022-09-19 -> 2022-09-26 --- pkgs/tools/admin/boulder/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/admin/boulder/default.nix b/pkgs/tools/admin/boulder/default.nix index 1b6f85b3abce..83a209d66302 100644 --- a/pkgs/tools/admin/boulder/default.nix +++ b/pkgs/tools/admin/boulder/default.nix @@ -7,7 +7,7 @@ buildGoModule rec { pname = "boulder"; - version = "2022-09-19"; + version = "2022-09-26"; src = fetchFromGitHub { owner = "letsencrypt"; @@ -19,7 +19,7 @@ buildGoModule rec { git rev-parse --short=8 HEAD 2>/dev/null >$out/COMMIT find "$out" -name .git -print0 | xargs -0 rm -rf ''; - hash = "sha256-hiE6Cdpn/NVLAsTxw3EaIzbwRSpG/yYCsAAeBDCG6m8="; + hash = "sha256-/JOUBgTDb4wCathg3nnOnnXh+Q/Zpeegg5MuPOaHowE="; }; vendorHash = null; From f6b1f7c61584fdad86642aa59597c06a8c54e8e4 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 06:34:30 +0000 Subject: [PATCH 071/113] dwm-status: 1.7.3 -> 1.8.0 --- pkgs/applications/window-managers/dwm/dwm-status.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/window-managers/dwm/dwm-status.nix b/pkgs/applications/window-managers/dwm/dwm-status.nix index 1b83e28309e0..a1b790b33da8 100644 --- a/pkgs/applications/window-managers/dwm/dwm-status.nix +++ b/pkgs/applications/window-managers/dwm/dwm-status.nix @@ -9,19 +9,19 @@ in rustPlatform.buildRustPackage rec { pname = "dwm-status"; - version = "1.7.3"; + version = "1.8.0"; src = fetchFromGitHub { owner = "Gerschtli"; repo = pname; rev = version; - sha256 = "sha256-dkVo9NpGt3G6by9Of1kOlXaZn7xsVSvfNXq7KPO6HE4="; + sha256 = "sha256-BCnEnBB0OCUwvhh4XEI2eOzfy34VHNFzbqqW26X6If0="; }; nativeBuildInputs = [ makeWrapper pkg-config ]; buildInputs = [ dbus gdk-pixbuf libnotify xorg.libX11 ]; - cargoSha256 = "sha256-QPnr7dUsq/RzuNLpbTRQbGB3zU6lNuPPPM9FmH4ydzY="; + cargoSha256 = "sha256-ylB0XGmIPW7Dbc6eDS8FZsq1AOOqntx1byaH3XIal0I="; postInstall = lib.optionalString (bins != []) '' wrapProgram $out/bin/dwm-status --prefix "PATH" : "${lib.makeBinPath bins}" From d2b9d9c1658e543971520bf3ff2e84cc8b974c61 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 03:35:07 +0000 Subject: [PATCH 072/113] velero: 1.9.1 -> 1.9.2 --- pkgs/applications/networking/cluster/velero/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/cluster/velero/default.nix b/pkgs/applications/networking/cluster/velero/default.nix index e587a671368b..49d9700feace 100644 --- a/pkgs/applications/networking/cluster/velero/default.nix +++ b/pkgs/applications/networking/cluster/velero/default.nix @@ -2,14 +2,14 @@ buildGoModule rec { pname = "velero"; - version = "1.9.1"; + version = "1.9.2"; src = fetchFromGitHub { owner = "vmware-tanzu"; repo = "velero"; rev = "v${version}"; - sha256 = "sha256-zGk5Bo1n2VV33wzozgYWbrwd/D3lcSWsqb+s3U3kmus="; + sha256 = "sha256-xhsHFb3X1oM68xnYiVEa0eZr7VFdUCkNzeyvci6wb9g="; }; ldflags = [ From 27c9a9bb845db1acdad879301558018c197c4f10 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 Sep 2022 22:37:49 +0000 Subject: [PATCH 073/113] pocketbase: 0.7.5 -> 0.7.6 --- pkgs/servers/pocketbase/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/pocketbase/default.nix b/pkgs/servers/pocketbase/default.nix index d3da831851d9..14c88e9d04f8 100644 --- a/pkgs/servers/pocketbase/default.nix +++ b/pkgs/servers/pocketbase/default.nix @@ -5,16 +5,16 @@ buildGoModule rec { pname = "pocketbase"; - version = "0.7.5"; + version = "0.7.6"; src = fetchFromGitHub { owner = "pocketbase"; repo = pname; rev = "v${version}"; - sha256 = "sha256-4UTAY7yGMYM84NNjzhnXNjPGyO2hOoINE925M4LLgJk="; + sha256 = "sha256-03CvpAATd8HSKaMY17Sl7v08xzTxrQsoBchkYZ5pz14="; }; - vendorSha256 = "sha256-Ty06TegTT4BILgH0MpnxINxBQMW0zi0ItptHmDqKW1k="; + vendorSha256 = "sha256-i3CRba2HA7dOEh4PU1rNZUl05pZqIm946lIjP7ZcFEc="; # This is the released subpackage from upstream repo subPackages = [ "examples/base" ]; From d2b86be46b372aa75559fe89c6061ecca0a31994 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 03:45:56 +0000 Subject: [PATCH 074/113] werf: 1.2.174 -> 1.2.175 --- pkgs/applications/networking/cluster/werf/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/cluster/werf/default.nix b/pkgs/applications/networking/cluster/werf/default.nix index 47553f953dbc..6c0571332179 100644 --- a/pkgs/applications/networking/cluster/werf/default.nix +++ b/pkgs/applications/networking/cluster/werf/default.nix @@ -10,13 +10,13 @@ buildGoModule rec { pname = "werf"; - version = "1.2.174"; + version = "1.2.175"; src = fetchFromGitHub { owner = "werf"; repo = "werf"; rev = "v${version}"; - hash = "sha256-8TuAreXWKCXThyiWwiSi5kDVHJKeMB8lpltWbVqGY34="; + hash = "sha256-p60+IBy9f31BfmKdYlaHPO93mpIpWeOrDa6vFYrL1eQ="; }; vendorHash = "sha256-NHRPl38/R7yS8Hht118mBc+OBPwfYiHOaGIwryNK8Mo="; From f56fbbc085eb860b7e7311a8a723648583649212 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 Sep 2022 15:13:22 +0000 Subject: [PATCH 075/113] gcsfuse: 0.41.6 -> 0.41.7 --- pkgs/tools/filesystems/gcsfuse/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/filesystems/gcsfuse/default.nix b/pkgs/tools/filesystems/gcsfuse/default.nix index 4f1f4bfb8ea4..3086a8c0a6ee 100644 --- a/pkgs/tools/filesystems/gcsfuse/default.nix +++ b/pkgs/tools/filesystems/gcsfuse/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "gcsfuse"; - version = "0.41.6"; + version = "0.41.7"; src = fetchFromGitHub { owner = "googlecloudplatform"; repo = "gcsfuse"; rev = "v${version}"; - sha256 = "sha256-yJVeR2e1i7f1LDhm415ukuC2OZRy1jS+/5oQ+fhhj8Q="; + sha256 = "sha256-hqT1X78g1Mg7xWHrVTwN41P+wgkrjfYrX2vHmwxZoCQ="; }; vendorSha256 = null; From c73061682ceb426189afb84b5db2f29b89135ef8 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 Sep 2022 08:24:45 +0000 Subject: [PATCH 076/113] iaito: 5.7.2 -> 5.7.4 --- pkgs/tools/security/iaito/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/iaito/default.nix b/pkgs/tools/security/iaito/default.nix index d8bfc9e4747c..cd45f9a58b60 100644 --- a/pkgs/tools/security/iaito/default.nix +++ b/pkgs/tools/security/iaito/default.nix @@ -17,13 +17,13 @@ stdenv.mkDerivation rec { pname = "iaito"; - version = "5.7.2"; + version = "5.7.4"; src = fetchFromGitHub { owner = "radareorg"; repo = pname; rev = version; - sha256 = "sha256-5/G5wfdc6aua90XLP3B7Ruy8F3NTXzWfQE6yVDZ0rX8="; + sha256 = "sha256-T9+YQQDcXHFogD7FVkippsde7+0bKodwwABCqrKjcH4="; }; nativeBuildInputs = [ meson ninja pkg-config python3 qttools wrapQtAppsHook ]; From 5c44d5e4f08ffa762bc00f523d5b0f9de48a08a5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 24 Sep 2022 19:58:02 +0000 Subject: [PATCH 077/113] roxctl: 3.71.0 -> 3.72.0 --- pkgs/applications/networking/cluster/roxctl/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/cluster/roxctl/default.nix b/pkgs/applications/networking/cluster/roxctl/default.nix index 44e96e8c486d..ed1f510ca0b0 100644 --- a/pkgs/applications/networking/cluster/roxctl/default.nix +++ b/pkgs/applications/networking/cluster/roxctl/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "roxctl"; - version = "3.71.0"; + version = "3.72.0"; src = fetchFromGitHub { owner = "stackrox"; repo = "stackrox"; rev = version; - sha256 = "sha256-svoSc9cT12nPYbyYz+Uv2edJAt/dJjcqe3E6cKII0KY="; + sha256 = "sha256-KsG6L3tQFuA0oTbzgLTChrBIe4a77bygJSIne/D4qiI="; }; - vendorSha256 = "sha256-zz8v9HkJPnk4QDRa9eVgI5uvqQLhemq8vOZ0qc9u8es="; + vendorSha256 = "sha256-FmpnRgU3w2zthgUJuAG5AqLl2UxMb0yywN5Sk9WoWBI="; nativeBuildInputs = [ installShellFiles ]; From 90fa265b6f672e6a911006cfa1096617fba5f200 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 24 Sep 2022 06:21:47 +0000 Subject: [PATCH 078/113] appgate-sdp: 6.0.1 -> 6.0.2 --- pkgs/applications/networking/appgate-sdp/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/appgate-sdp/default.nix b/pkgs/applications/networking/appgate-sdp/default.nix index a5bc03596d4d..b93fcc1903b3 100644 --- a/pkgs/applications/networking/appgate-sdp/default.nix +++ b/pkgs/applications/networking/appgate-sdp/default.nix @@ -87,11 +87,11 @@ let in stdenv.mkDerivation rec { pname = "appgate-sdp"; - version = "6.0.1"; + version = "6.0.2"; src = fetchurl { url = "https://bin.appgate-sdp.com/${versions.majorMinor version}/client/appgate-sdp_${version}_amd64.deb"; - sha256 = "sha256-dVVOUdGJDmStS1ZXqPOFpeWhLgimv4lHBS/OOEDrtM0="; + sha256 = "sha256-ut5a/tpWEQX1Jug9IZksnxbQ/rs2pGNh8zBb2a43KUE="; }; # just patch interpreter From aae4790ef952fec69813c3caa9d669160488ac6c Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 24 Sep 2022 06:50:31 +0000 Subject: [PATCH 079/113] bitwig-studio: 4.3.4 -> 4.3.8 --- pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix b/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix index 401b759016a0..4752ca174f16 100644 --- a/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix +++ b/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix @@ -6,11 +6,11 @@ stdenv.mkDerivation rec { pname = "bitwig-studio"; - version = "4.3.4"; + version = "4.3.8"; src = fetchurl { url = "https://downloads.bitwig.com/stable/${version}/${pname}-${version}.deb"; - sha256 = "sha256-2CCxpQPZB5F5jwJCux1OqGuxCuFZus5vlCrmStmI0F8="; + sha256 = "sha256-mJIzlY1m/r56e7iw5Hm+u2EbpHn5JqOMaRjpbCe8HHw="; }; nativeBuildInputs = [ dpkg makeWrapper wrapGAppsHook ]; From 2f3ac56b362522de118533f1eaf0ef9fdcefb249 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 15 Sep 2022 06:34:41 +0000 Subject: [PATCH 080/113] alfaview: 8.52.0 -> 8.53.1 --- .../networking/instant-messengers/alfaview/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/alfaview/default.nix b/pkgs/applications/networking/instant-messengers/alfaview/default.nix index e4813cbbf343..b8995aa87593 100644 --- a/pkgs/applications/networking/instant-messengers/alfaview/default.nix +++ b/pkgs/applications/networking/instant-messengers/alfaview/default.nix @@ -5,11 +5,11 @@ stdenv.mkDerivation rec { pname = "alfaview"; - version = "8.52.0"; + version = "8.53.1"; src = fetchurl { url = "https://production-alfaview-assets.alfaview.com/stable/linux/${pname}_${version}.deb"; - sha256 = "sha256-Taw/qMrqgxFWmRTSed8xINDBGTWx7kteN637Fjrzn44="; + sha256 = "sha256-nohChte0jtqIlDulxUi+S04unR4xqeg8DCuYfHwMzP4="; }; nativeBuildInputs = [ From da879a3e4cb46a5df4f3f334857cc5789056c95f Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 Sep 2022 05:34:42 +0000 Subject: [PATCH 081/113] qpwgraph: 0.3.5 -> 0.3.6 --- pkgs/applications/audio/qpwgraph/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/qpwgraph/default.nix b/pkgs/applications/audio/qpwgraph/default.nix index f09de4001b1b..e9b6e76368e9 100644 --- a/pkgs/applications/audio/qpwgraph/default.nix +++ b/pkgs/applications/audio/qpwgraph/default.nix @@ -5,14 +5,14 @@ mkDerivation rec { pname = "qpwgraph"; - version = "0.3.5"; + version = "0.3.6"; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; owner = "rncbc"; repo = "qpwgraph"; rev = "v${version}"; - sha256 = "sha256-ZpVQjlqz1aPpf04qHMsN06s1n5msf32oB7cJYZf6xAU="; + sha256 = "sha256-uN3SAmpurINV+7vw51fWdwnuW2yBxnedY6BXdwn/S2s="; }; nativeBuildInputs = [ cmake pkg-config ]; From 0244d67891c1e3d19227aa56e80012e1d3ac8e7f Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 25 Sep 2022 16:25:39 +0000 Subject: [PATCH 082/113] octosql: 0.9.3 -> 0.10.0 --- pkgs/tools/misc/octosql/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/octosql/default.nix b/pkgs/tools/misc/octosql/default.nix index 8a31ab58fa8c..2dbe6c7eb988 100644 --- a/pkgs/tools/misc/octosql/default.nix +++ b/pkgs/tools/misc/octosql/default.nix @@ -5,13 +5,13 @@ buildGoModule rec { pname = "octosql"; - version = "0.9.3"; + version = "0.10.0"; src = fetchFromGitHub { owner = "cube2222"; repo = pname; rev = "v${version}"; - sha256 = "sha256-Y6kKYW79415nCJkcIKQjcBQiFZrRCJ8If65lV9wmNFA="; + sha256 = "sha256-qeF34GBR/OtvWBN5mcLMJGzOI/3DzbScJVM0pvlTvyw="; }; vendorSha256 = "sha256-ukNjLk1tTdw0bwXaYAEDuHfzxHuAX1xyqRqC6wmW/H4="; From a3a20468a64ab98c51611826550acf084c6acde1 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 02:56:09 +0000 Subject: [PATCH 083/113] python310Packages.pontos: 22.9.1 -> 22.9.3 --- pkgs/development/python-modules/pontos/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pontos/default.nix b/pkgs/development/python-modules/pontos/default.nix index c2e6bd2842eb..358af52ef70f 100644 --- a/pkgs/development/python-modules/pontos/default.nix +++ b/pkgs/development/python-modules/pontos/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "pontos"; - version = "22.9.1"; + version = "22.9.3"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -23,7 +23,7 @@ buildPythonPackage rec { owner = "greenbone"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-W0WubsulnMtNbW/KP1Sp1ChEb3ie1s+Oxu23jpnB/Nc="; + hash = "sha256-YqOeeivOscH1YtYXu348ozY25vHFkD9q1OFJ/jfZJLk="; }; nativeBuildInputs = [ From 868658f9268c2c8f19c815efd39cae08fc89db59 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 03:12:21 +0000 Subject: [PATCH 084/113] python310Packages.pulumi-aws: 5.14.0 -> 5.16.0 --- pkgs/development/python-modules/pulumi-aws/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pulumi-aws/default.nix b/pkgs/development/python-modules/pulumi-aws/default.nix index e6aaa0cd2021..11b58e65d0ee 100644 --- a/pkgs/development/python-modules/pulumi-aws/default.nix +++ b/pkgs/development/python-modules/pulumi-aws/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { pname = "pulumi-aws"; # Version is independant of pulumi's. - version = "5.14.0"; + version = "5.16.0"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "pulumi"; repo = "pulumi-aws"; rev = "refs/tags/v${version}"; - hash = "sha256-ZdmPpjuc9z76wnNImX9BhNNAFDw1EDEZV8IAm01hfss="; + hash = "sha256-SyRSRcKCIIaoyLdWYfFERjRp3pyXHGn35WXMqjOe3DY="; }; sourceRoot = "${src.name}/sdk/python"; From 4cdac93a5d1b0726aaeb2a1306c04031b244e80d Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 05:33:52 +0000 Subject: [PATCH 085/113] python310Packages.pytest-testmon: 1.3.6 -> 1.3.7 --- pkgs/development/python-modules/pytest-testmon/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pytest-testmon/default.nix b/pkgs/development/python-modules/pytest-testmon/default.nix index 5d6117d35e2f..4e3001ea6233 100644 --- a/pkgs/development/python-modules/pytest-testmon/default.nix +++ b/pkgs/development/python-modules/pytest-testmon/default.nix @@ -8,14 +8,14 @@ buildPythonPackage rec { pname = "pytest-testmon"; - version = "1.3.6"; + version = "1.3.7"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-KcDVOKAuQ5iVKgK3o1Vnc+LUVsI1izTnkOmByiyCJ1E="; + hash = "sha256-tjdu4mEslRl7QGnNGg7ATaQCipwF5/XSpFPq3E3A/Vo="; }; buildInputs = [ From 7f91be123709ee30d218bfc5b0ce4ebb4dd0f3af Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 03:33:05 +0000 Subject: [PATCH 086/113] python310Packages.psd-tools: 1.9.22 -> 1.9.23 --- pkgs/development/python-modules/psd-tools/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/psd-tools/default.nix b/pkgs/development/python-modules/psd-tools/default.nix index a4be2b11d5e0..96be2af48b14 100644 --- a/pkgs/development/python-modules/psd-tools/default.nix +++ b/pkgs/development/python-modules/psd-tools/default.nix @@ -14,13 +14,13 @@ buildPythonPackage rec { pname = "psd-tools"; - version = "1.9.22"; + version = "1.9.23"; src = fetchFromGitHub { owner = "psd-tools"; repo = pname; rev = "refs/tags/v${version}"; - sha256 = "sha256-T3/KLirU69Mdu7pQ6NFEVzhesaYhYsdK6DjTJQivPBQ="; + sha256 = "sha256-pJUf5rE5QMnfNytU1P0Zbj1iztrK5xrX4CJ/WvIG8mY="; }; nativeBuildInputs = [ cython ]; From 18621744d6e9b3e79b6e8235f093501761e70231 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 03:43:13 +0000 Subject: [PATCH 087/113] python310Packages.pyvo: 1.3 -> 1.4 --- pkgs/development/python-modules/pyvo/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pyvo/default.nix b/pkgs/development/python-modules/pyvo/default.nix index c04c70ebc60a..35da20d648d0 100644 --- a/pkgs/development/python-modules/pyvo/default.nix +++ b/pkgs/development/python-modules/pyvo/default.nix @@ -13,13 +13,13 @@ buildPythonPackage rec { pname = "pyvo"; - version = "1.3"; + version = "1.4"; disabled = pythonOlder "3.8"; # according to setup.cfg src = fetchPypi { inherit pname version; - sha256 = "846a54a05a8ddb47a8c2cc3077434779b0e4ccc1b74a7a5408593cb673307d67"; + sha256 = "sha256-R2ttLoFd6Ic0KZl49dzN5NtWAqPpXRaeki6X8CRGsCw="; }; SETUPTOOLS_SCM_PRETEND_VERSION = version; From 4fafb2c018034cac64e1244406c7b6ae3ff6fb25 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 05:41:01 +0000 Subject: [PATCH 088/113] python310Packages.python-gitlab: 3.9.0 -> 3.10.0 --- pkgs/development/python-modules/python-gitlab/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/python-gitlab/default.nix b/pkgs/development/python-modules/python-gitlab/default.nix index eb4316989733..09dade7107a5 100644 --- a/pkgs/development/python-modules/python-gitlab/default.nix +++ b/pkgs/development/python-modules/python-gitlab/default.nix @@ -10,14 +10,14 @@ buildPythonPackage rec { pname = "python-gitlab"; - version = "3.9.0"; + version = "3.10.0"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-X8Xoj4HzZuEYUcuLS5pbgnSRziC6dYVEa3TJsJdya6M="; + sha256 = "sha256-FJMKFv3X829nuTc+fU1HIOjjdIAAKDgCidszBun3RhQ="; }; propagatedBuildInputs = [ From 932ca1db3da602646f2721d31628e8c617b91d3f Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 03:53:06 +0000 Subject: [PATCH 089/113] python310Packages.pyfuse3: 3.2.1 -> 3.2.2 --- pkgs/development/python-modules/pyfuse3/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pyfuse3/default.nix b/pkgs/development/python-modules/pyfuse3/default.nix index 07ba27c0ef7d..e7b545d2a5ec 100644 --- a/pkgs/development/python-modules/pyfuse3/default.nix +++ b/pkgs/development/python-modules/pyfuse3/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "pyfuse3"; - version = "3.2.1"; + version = "3.2.2"; disabled = pythonOlder "3.5"; @@ -23,8 +23,8 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "libfuse"; repo = "pyfuse3"; - rev = "release-${version}"; - hash = "sha256-JGbp2bSI/Rvyys1xMd2o34KlqqBsV6B9LhuuNopayYA="; + rev = "refs/tags/${version}"; + hash = "sha256-Y9Haz3MMhTXkvYFOGNWJnoGNnvoK6wiQ+s3AwJhBD8Q="; }; postPatch = '' From 5774027416784eaa0d2419dfdab4bf0f4f8ef345 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 05:41:40 +0000 Subject: [PATCH 090/113] python310Packages.python-gvm: 22.7.0 -> 22.9.1 --- pkgs/development/python-modules/python-gvm/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/python-gvm/default.nix b/pkgs/development/python-modules/python-gvm/default.nix index cc3d8667073c..0a7af2f40d81 100644 --- a/pkgs/development/python-modules/python-gvm/default.nix +++ b/pkgs/development/python-modules/python-gvm/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { pname = "python-gvm"; - version = "22.7.0"; + version = "22.9.1"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "greenbone"; repo = pname; rev = "refs/tags/v${version}"; - sha256 = "sha256-0dshBFcZ0DLa6SXxzWyfzmgPPxTIiKq00OKCJfk0vKY="; + sha256 = "sha256-V9xfPYwDDoCGJPstzYsC/ikUp45uiaZE0Bg4i9tRNhU="; }; nativeBuildInputs = [ From 98f590d6771663718a33c605a960e59ded49ac2e Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 00:35:51 +0000 Subject: [PATCH 091/113] python310Packages.jc: 1.21.2 -> 1.22.0 --- pkgs/development/python-modules/jc/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/jc/default.nix b/pkgs/development/python-modules/jc/default.nix index 7cce5dca7aa5..f0c808459d2f 100644 --- a/pkgs/development/python-modules/jc/default.nix +++ b/pkgs/development/python-modules/jc/default.nix @@ -10,14 +10,14 @@ buildPythonPackage rec { pname = "jc"; - version = "1.21.2"; + version = "1.22.0"; disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "kellyjonbrazil"; repo = pname; - rev = "v${version}"; - sha256 = "sha256-gzxN2ZbnZw7EE5oVeSpugzl/paAbyKKQlxVs/8n3Hzw="; + rev = "refs/tags/v${version}"; + sha256 = "sha256-cRa52rFZlSH0D5u9L7NcWbQGCNdOlRE2koRi8VgVpAo="; }; propagatedBuildInputs = [ ruamel-yaml xmltodict pygments ]; From aaac522df6842594690cd090359c889f52ff1506 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 01:10:25 +0000 Subject: [PATCH 092/113] python310Packages.limnoria: 2022.8.7 -> 2022.9.20 --- pkgs/development/python-modules/limnoria/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/limnoria/default.nix b/pkgs/development/python-modules/limnoria/default.nix index 7f95f4ae138c..2acb735052bd 100644 --- a/pkgs/development/python-modules/limnoria/default.nix +++ b/pkgs/development/python-modules/limnoria/default.nix @@ -15,14 +15,14 @@ buildPythonPackage rec { pname = "limnoria"; - version = "2022.8.7"; + version = "2022.9.20"; format = "setuptools"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - hash = "sha256-TRTqhWQSVhjJkd9FLJk1lDwdzyzkeih9zHPSOvTf2oQ="; + hash = "sha256-db+JKQXDffMm5dcyMVtYNj1YFKHSlvYAoyZi86tqoiA="; }; propagatedBuildInputs = [ From b1b6551b95d4bde3ba8186286ba4de07486022a3 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 00:34:38 +0000 Subject: [PATCH 093/113] python310Packages.jarowinkler: 1.2.2 -> 1.2.3 --- pkgs/development/python-modules/jarowinkler/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/jarowinkler/default.nix b/pkgs/development/python-modules/jarowinkler/default.nix index 03e32e56af31..b71187c9feae 100644 --- a/pkgs/development/python-modules/jarowinkler/default.nix +++ b/pkgs/development/python-modules/jarowinkler/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { pname = "jarowinkler"; - version = "1.2.2"; + version = "1.2.3"; disabled = pythonOlder "3.6"; @@ -25,7 +25,7 @@ buildPythonPackage rec { owner = "maxbachmann"; repo = "JaroWinkler"; rev = "refs/tags/v${version}"; - hash = "sha256-1jImgRvGQ2x3Swkq43gq0IhgZTzIBtedoqN11hvDGns="; + hash = "sha256-j+ZabVsiVitNkTPhGjDg72XogjvPaL453lTW45ITm90="; }; nativeBuildInputs = [ From 5a3df78d7894258b5f34a419f082d455985f3cac Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 02:17:42 +0000 Subject: [PATCH 094/113] python310Packages.oci: 2.83.0 -> 2.84.0 --- pkgs/development/python-modules/oci/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/oci/default.nix b/pkgs/development/python-modules/oci/default.nix index c81821b9eb1e..3377d44ae936 100644 --- a/pkgs/development/python-modules/oci/default.nix +++ b/pkgs/development/python-modules/oci/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { pname = "oci"; - version = "2.83.0"; + version = "2.84.0"; format = "setuptools"; disabled = pythonOlder "3.6"; @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "oracle"; repo = "oci-python-sdk"; rev = "refs/tags/v${version}"; - hash = "sha256-Wwq2o4A8UK4Gj5PvqQqQLYpCLRHTkhS4eygToTAIOwU="; + hash = "sha256-nG8bml9mTlKz48PhQjrLmAYYznb1qlrEI+XgvpM9zlk="; }; propagatedBuildInputs = [ From 0cef916f2cb6418eebf67949a4d682c3fce8a9d4 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 02:03:55 +0200 Subject: [PATCH 095/113] python310Packages.archinfo: 9.2.19 -> 9.2.20 --- pkgs/development/python-modules/archinfo/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/archinfo/default.nix b/pkgs/development/python-modules/archinfo/default.nix index 0e32aec5df22..0ef8a492a639 100644 --- a/pkgs/development/python-modules/archinfo/default.nix +++ b/pkgs/development/python-modules/archinfo/default.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { pname = "archinfo"; - version = "9.2.19"; + version = "9.2.20"; format = "pyproject"; disabled = pythonOlder "3.8"; @@ -16,7 +16,7 @@ buildPythonPackage rec { owner = "angr"; repo = pname; rev = "v${version}"; - hash = "sha256-zfDOIkXwt393tu9QPXz/ADyIK3mJCQ6oSgKcaMipHLg="; + hash = "sha256-JitAp536AM0EnE+LWlKceoYIk/gYxnbOUPtX7CK5SiM="; }; checkInputs = [ From 5d4a329889777a00488601fcf333655e2b1ceb0c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 02:03:58 +0200 Subject: [PATCH 096/113] python310Packages.ailment: 9.2.19 -> 9.2.20 --- pkgs/development/python-modules/ailment/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/ailment/default.nix b/pkgs/development/python-modules/ailment/default.nix index c43efdccb6fa..7063ba63387c 100644 --- a/pkgs/development/python-modules/ailment/default.nix +++ b/pkgs/development/python-modules/ailment/default.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { pname = "ailment"; - version = "9.2.19"; + version = "9.2.20"; format = "pyproject"; disabled = pythonOlder "3.8"; @@ -16,7 +16,7 @@ buildPythonPackage rec { owner = "angr"; repo = pname; rev = "v${version}"; - hash = "sha256-nm8vumylqNefSN+RE/3nUB+fzwznnkefDlXeQGQdfEw="; + hash = "sha256-dfogVQZ6RP1GyuoiTEC/VLancb+ZmdM1xPSngLbcmYs="; }; propagatedBuildInputs = [ From 873b1e97a8749eb790502ec762a83deddbbc7ced Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 02:04:03 +0200 Subject: [PATCH 097/113] python310Packages.pyvex: 9.2.19 -> 9.2.20 --- pkgs/development/python-modules/pyvex/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pyvex/default.nix b/pkgs/development/python-modules/pyvex/default.nix index 9d3abfa1f66c..586b2bf29ee3 100644 --- a/pkgs/development/python-modules/pyvex/default.nix +++ b/pkgs/development/python-modules/pyvex/default.nix @@ -12,14 +12,14 @@ buildPythonPackage rec { pname = "pyvex"; - version = "9.2.19"; + version = "9.2.20"; format = "pyproject"; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-f/Oc5IOVkOqCkpWnNclQ8eC4YZU9Iz/q4kfcTkP5x0o="; + hash = "sha256-qMWJk+vq8JyHjkEScpnlfRG7NzmyH6VyoZLNMAz6BWI="; }; propagatedBuildInputs = [ From 4404c287304b952aa9e6a63407de4cc274de9de7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 02:04:06 +0200 Subject: [PATCH 098/113] python310Packages.claripy: 9.2.19 -> 9.2.20 --- pkgs/development/python-modules/claripy/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/claripy/default.nix b/pkgs/development/python-modules/claripy/default.nix index cc2eaa9576a0..e516e7eac8f9 100644 --- a/pkgs/development/python-modules/claripy/default.nix +++ b/pkgs/development/python-modules/claripy/default.nix @@ -14,7 +14,7 @@ buildPythonPackage rec { pname = "claripy"; - version = "9.2.19"; + version = "9.2.20"; format = "pyproject"; disabled = pythonOlder "3.8"; @@ -23,7 +23,7 @@ buildPythonPackage rec { owner = "angr"; repo = pname; rev = "v${version}"; - hash = "sha256-amCt7ccAKXNicCHvhu0pLUKXPlkrD8UpLO94D78OGAk="; + hash = "sha256-G4Tes9X7dz+bBTJCdbr3o4nTlN2c4Ixtl6iwZv0XYvA="; }; propagatedBuildInputs = [ From 4a3f62329ea8ba32fafb0dc1d194077e087e5e27 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 02:04:09 +0200 Subject: [PATCH 099/113] python310Packages.cle: 9.2.19 -> 9.2.20 --- pkgs/development/python-modules/cle/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/cle/default.nix b/pkgs/development/python-modules/cle/default.nix index 7ac00249b43d..0b6326fc4efa 100644 --- a/pkgs/development/python-modules/cle/default.nix +++ b/pkgs/development/python-modules/cle/default.nix @@ -15,7 +15,7 @@ let # The binaries are following the argr projects release cycle - version = "9.2.19"; + version = "9.2.20"; # Binary files from https://github.com/angr/binaries (only used for testing and only here) binaries = fetchFromGitHub { @@ -37,7 +37,7 @@ buildPythonPackage rec { owner = "angr"; repo = pname; rev = "v${version}"; - hash = "sha256-uwCSgq7l5VByN1YPuqdnvj2ImV/rb8Xn7dz1p7EvrdQ="; + hash = "sha256-ORNlmdkAlMj1CaWj5pDve0yJe3TEv9IfKOwqRd+gVH4="; }; propagatedBuildInputs = [ From fcd37ca748b89745754d775c3ec1f6a3890e03d6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 02:04:13 +0200 Subject: [PATCH 100/113] python310Packages.angr: 9.2.19 -> 9.2.20 --- pkgs/development/python-modules/angr/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/angr/default.nix b/pkgs/development/python-modules/angr/default.nix index c57ec4de6e13..9a841aae8fd4 100644 --- a/pkgs/development/python-modules/angr/default.nix +++ b/pkgs/development/python-modules/angr/default.nix @@ -46,7 +46,7 @@ in buildPythonPackage rec { pname = "angr"; - version = "9.2.19"; + version = "9.2.20"; format = "pyproject"; disabled = pythonOlder "3.8"; @@ -55,7 +55,7 @@ buildPythonPackage rec { owner = pname; repo = pname; rev = "v${version}"; - hash = "sha256-3hgEWmP8uwSGE5gh5HAs7xMJnnzY1hlwE8UqW/dzk7c="; + hash = "sha256-MQT9iebGVGM89QybQ/GcjfPHrp0ZeNsjYrXV9ITNSsM="; }; propagatedBuildInputs = [ From d050bc18737ea3ad80f573b369d91861dafed69b Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 27 Sep 2022 20:47:36 +0000 Subject: [PATCH 101/113] python310Packages.dnslib: 0.9.21 -> 0.9.22 --- pkgs/development/python-modules/dnslib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/dnslib/default.nix b/pkgs/development/python-modules/dnslib/default.nix index 2d70c00579eb..272581e5439a 100644 --- a/pkgs/development/python-modules/dnslib/default.nix +++ b/pkgs/development/python-modules/dnslib/default.nix @@ -2,11 +2,11 @@ buildPythonPackage rec { pname = "dnslib"; - version = "0.9.21"; + version = "0.9.22"; src = fetchPypi { inherit pname version; - sha256 = "sha256-IXabARWP5wvokSF1Q0nyg13M3yHVwBHOyfoopI+lVdQ="; + sha256 = "sha256-EK/JT2pfHLiziCTgQuJeVBTh+q7f05s0iujZdyKSGoY="; }; checkPhase = "VERSIONS=${python.interpreter} ./run_tests.sh"; From b43a371f2a368d5ab1446630463cdf2e5fb2602f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 01:55:00 +0200 Subject: [PATCH 102/113] python310Packages.dnslib: add pythonImportsCheck - update meta - disable on older Python releases --- .../python-modules/dnslib/default.nix | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/dnslib/default.nix b/pkgs/development/python-modules/dnslib/default.nix index 272581e5439a..11f387d2469c 100644 --- a/pkgs/development/python-modules/dnslib/default.nix +++ b/pkgs/development/python-modules/dnslib/default.nix @@ -1,20 +1,34 @@ -{ lib, python, buildPythonPackage, fetchPypi }: +{ lib +, python +, buildPythonPackage +, fetchPypi +, pythonOlder +}: buildPythonPackage rec { pname = "dnslib"; version = "0.9.22"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-EK/JT2pfHLiziCTgQuJeVBTh+q7f05s0iujZdyKSGoY="; + hash = "sha256-EK/JT2pfHLiziCTgQuJeVBTh+q7f05s0iujZdyKSGoY="; }; - checkPhase = "VERSIONS=${python.interpreter} ./run_tests.sh"; + checkPhase = '' + VERSIONS=${python.interpreter} ./run_tests.sh + ''; + + pythonImportsCheck = [ + "dnslib" + ]; meta = with lib; { description = "Simple library to encode/decode DNS wire-format packets"; + homepage = "https://github.com/paulc/dnslib"; license = licenses.bsd2; - homepage = "https://bitbucket.org/paulc/dnslib/"; maintainers = with maintainers; [ delroth ]; }; } From 3905b8f8e1e0e0d04535e8c869c6e715bddc6ac5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 00:50:12 +0000 Subject: [PATCH 103/113] python310Packages.jupyter_server: 1.18.1 -> 1.19.1 --- pkgs/development/python-modules/jupyter_server/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/jupyter_server/default.nix b/pkgs/development/python-modules/jupyter_server/default.nix index 657e7a9ce300..f031528db3e6 100644 --- a/pkgs/development/python-modules/jupyter_server/default.nix +++ b/pkgs/development/python-modules/jupyter_server/default.nix @@ -30,12 +30,12 @@ buildPythonPackage rec { pname = "jupyter_server"; - version = "1.18.1"; + version = "1.19.1"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-K3L8WVvMrikiYKrYFXoOrY2ixwPsauG7ezbbrQ4mfqc="; + sha256 = "sha256-0cw1lpRYSXQrw+7fBpn+61CtbGBF6+8CqSmLfxPCfp8="; }; propagatedBuildInputs = [ From 7d226b5d12965b214d299d553fff6a3db7e4202a Mon Sep 17 00:00:00 2001 From: illustris Date: Wed, 28 Sep 2022 11:18:56 +0530 Subject: [PATCH 104/113] python310Packages.skein: 0.8.1 -> 0.8.2 --- pkgs/development/python-modules/skein/default.nix | 6 +++--- pkgs/development/python-modules/skein/skeinjar.nix | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/skein/default.nix b/pkgs/development/python-modules/skein/default.nix index 8dc3391e9e97..703cc2332a17 100644 --- a/pkgs/development/python-modules/skein/default.nix +++ b/pkgs/development/python-modules/skein/default.nix @@ -14,13 +14,13 @@ buildPythonPackage rec { pname = "skein"; - version = "0.8.1"; + version = "0.8.2"; src = fetchPypi { inherit pname version; - sha256 = "04208b4be9df2dc68ac5b3e3ae51fd9b589add95ea1b67222a8de754d17b1efa"; + hash = "sha256-nXTqsJNX/LwAglPcPZkmdYPfF+vDLN+nNdZaDFTrHzE="; }; # Update this hash if bumping versions - jarHash = "sha256-UGiEoTZ17IhLG72FZ18Zb+Ej4T8z9rMIMDUxzSZGZyY="; + jarHash = "sha256-x2KH6tnoG7sogtjrJvUaxy0PCEA8q/zneuI969oBOKo="; skeinJar = callPackage ./skeinjar.nix { inherit pname version jarHash; }; propagatedBuildInputs = [ cryptography grpcio pyyaml ]; diff --git a/pkgs/development/python-modules/skein/skeinjar.nix b/pkgs/development/python-modules/skein/skeinjar.nix index d559f237bf71..1cec80fa9333 100644 --- a/pkgs/development/python-modules/skein/skeinjar.nix +++ b/pkgs/development/python-modules/skein/skeinjar.nix @@ -6,6 +6,8 @@ stdenv.mkDerivation rec { src = fetchPypi { inherit pname version; format = "wheel"; + python = "py3"; + dist = "py3"; hash = jarHash; }; @@ -15,6 +17,6 @@ stdenv.mkDerivation rec { installPhase = '' unzip ${src} - mv ./skein/java/skein.jar $out + install -D ./skein/java/skein.jar $out ''; } From 87ea5229dca5f8996d6eb6c40c18f30aa74d52dc Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 09:16:51 +0200 Subject: [PATCH 105/113] python310Packages.dbus-fast: 1.15.1 -> 1.17.0 --- pkgs/development/python-modules/dbus-fast/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/dbus-fast/default.nix b/pkgs/development/python-modules/dbus-fast/default.nix index f95da372a4b7..623ee4a7888d 100644 --- a/pkgs/development/python-modules/dbus-fast/default.nix +++ b/pkgs/development/python-modules/dbus-fast/default.nix @@ -10,7 +10,7 @@ buildPythonPackage rec { pname = "dbus-fast"; - version = "1.15.1"; + version = "1.17.0"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -19,7 +19,7 @@ buildPythonPackage rec { owner = "Bluetooth-Devices"; repo = pname; rev = "v${version}"; - hash = "sha256-Uq+f0l9/W6PjP9MczF3VJNJicDgOnMrfXpOkHp7frVY="; + hash = "sha256-HbjeO+imWocc5bL62gdWHf8kBR6HNWwEu+KqO4ldHe4="; }; nativeBuildInputs = [ From be9579d6834b676f182d590718a3d6b8addee151 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 09:19:24 +0200 Subject: [PATCH 106/113] python310Packages.aiopyarr: 22.7.0 -> 22.9.0 --- pkgs/development/python-modules/aiopyarr/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/aiopyarr/default.nix b/pkgs/development/python-modules/aiopyarr/default.nix index a2e66b42af74..e9dec57f4d18 100644 --- a/pkgs/development/python-modules/aiopyarr/default.nix +++ b/pkgs/development/python-modules/aiopyarr/default.nix @@ -10,7 +10,7 @@ buildPythonPackage rec { pname = "aiopyarr"; - version = "22.7.0"; + version = "22.9.0"; format = "setuptools"; disabled = pythonOlder "3.9"; @@ -19,7 +19,7 @@ buildPythonPackage rec { owner = "tkdrob"; repo = pname; rev = version; - hash = "sha256-ALFaWy/wY8PTuMixHEWaXXmKNSLf9Cm2pgffVHnAWLg="; + hash = "sha256-nJjqpk4GcgXJhFZd4E3vSmyNP+RkOASEd4Ipemx6cAc="; }; propagatedBuildInputs = [ From 7ebc5c2ddfc7830c535353b4a4a429b4e185ab07 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 09:20:22 +0200 Subject: [PATCH 107/113] python310Packages.yalexs: 1.2.1 -> 1.2.3 --- pkgs/development/python-modules/yalexs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/yalexs/default.nix b/pkgs/development/python-modules/yalexs/default.nix index 8a320eb103a0..638e5002885b 100644 --- a/pkgs/development/python-modules/yalexs/default.nix +++ b/pkgs/development/python-modules/yalexs/default.nix @@ -17,7 +17,7 @@ buildPythonPackage rec { pname = "yalexs"; - version = "1.2.1"; + version = "1.2.3"; format = "setuptools"; disabled = pythonOlder "3.6"; @@ -26,7 +26,7 @@ buildPythonPackage rec { owner = "bdraco"; repo = pname; rev = "v${version}"; - sha256 = "sha256-7+4Icg3E6xrWmxObNzNuDc+MXJ9rnbgBHMK4uPBJeuY="; + sha256 = "sha256-O7a94UC7AB7MiTTpf68PWfim9anfYEWbvgsQsTV74VA="; }; propagatedBuildInputs = [ From f40a2a70cd818fe91c85186bf989fc177e486dea Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 Sep 2022 08:10:22 +0000 Subject: [PATCH 108/113] checkSSLCert: 2.48.0 -> 2.49.0 --- pkgs/servers/monitoring/nagios/plugins/check_ssl_cert.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/monitoring/nagios/plugins/check_ssl_cert.nix b/pkgs/servers/monitoring/nagios/plugins/check_ssl_cert.nix index e248e3fbbd1a..7fd79a6e6f8f 100644 --- a/pkgs/servers/monitoring/nagios/plugins/check_ssl_cert.nix +++ b/pkgs/servers/monitoring/nagios/plugins/check_ssl_cert.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { pname = "check_ssl_cert"; - version = "2.48.0"; + version = "2.49.0"; src = fetchFromGitHub { owner = "matteocorti"; repo = "check_ssl_cert"; rev = "v${version}"; - hash = "sha256-uaDeg7Dph99NWN0pKHrffBYOOzN8/1fW2YBEE8vnYMs="; + hash = "sha256-V6NahQvHrDna7II6GbUadiq5IBrEVTW2EQ6+FxV5zQQ="; }; nativeBuildInputs = [ From 6bb249e65a857e05378161097790cc8460cb495b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 28 Sep 2022 10:11:40 +0200 Subject: [PATCH 109/113] python310Packages.hmmlearn: disable on older Python releases --- .../python-modules/hmmlearn/default.nix | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/hmmlearn/default.nix b/pkgs/development/python-modules/hmmlearn/default.nix index 153c582b7cf0..ea39c4324566 100644 --- a/pkgs/development/python-modules/hmmlearn/default.nix +++ b/pkgs/development/python-modules/hmmlearn/default.nix @@ -1,27 +1,55 @@ -{ lib, fetchurl, buildPythonPackage -, numpy, scikit-learn, pybind11, setuptools-scm, cython -, pytestCheckHook }: +{ lib +, fetchurl +, buildPythonPackage +, numpy +, scikit-learn +, pybind11 +, setuptools-scm +, cython +, pytestCheckHook +, pythonOlder +}: buildPythonPackage rec { pname = "hmmlearn"; version = "0.2.8"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; src = fetchurl { url = "mirror://pypi/h/hmmlearn/${pname}-${version}.tar.gz"; - sha256 = "sha256-aWkx49zmgBzJt4xin1QwYd1+tnpxFVsD0bOeoXKipfk="; + hash = "sha256-aWkx49zmgBzJt4xin1QwYd1+tnpxFVsD0bOeoXKipfk="; }; - buildInputs = [ setuptools-scm cython pybind11 ]; - propagatedBuildInputs = [ numpy scikit-learn ]; - checkInputs = [ pytestCheckHook ]; + buildInputs = [ + setuptools-scm + cython + pybind11 + ]; - pythonImportsCheck = [ "hmmlearn" ]; - pytestFlagsArray = [ "--pyargs" "hmmlearn" ]; + propagatedBuildInputs = [ + numpy + scikit-learn + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "hmmlearn" + ]; + + pytestFlagsArray = [ + "--pyargs" + "hmmlearn" + ]; meta = with lib; { description = "Hidden Markov Models in Python with scikit-learn like API"; - homepage = "https://github.com/hmmlearn/hmmlearn"; - license = licenses.bsd3; + homepage = "https://github.com/hmmlearn/hmmlearn"; + license = licenses.bsd3; maintainers = with maintainers; [ abbradar ]; }; } From d2356bf415cce09b2c716489e419128285c4cacf Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Tue, 27 Sep 2022 09:45:48 +0200 Subject: [PATCH 110/113] onnxruntime: add Python support --- .../libraries/onnxruntime/default.nix | 31 ++++++++++++++++--- pkgs/top-level/python-packages.nix | 5 +++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/onnxruntime/default.nix b/pkgs/development/libraries/onnxruntime/default.nix index 77730cb8820e..e297f835f326 100644 --- a/pkgs/development/libraries/onnxruntime/default.nix +++ b/pkgs/development/libraries/onnxruntime/default.nix @@ -5,7 +5,7 @@ , fetchurl , pkg-config , cmake -, python3 +, python3Packages , libpng , zlib , eigen @@ -15,6 +15,9 @@ , boost , oneDNN , gtest +, pythonSupport ? true +, nsync +, flatbuffers }: let @@ -49,9 +52,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config - python3 + python3Packages.python gtest - ]; + ] ++ lib.optionals pythonSupport (with python3Packages; [ + setuptools + wheel + pip + ]); buildInputs = [ libpng @@ -61,10 +68,16 @@ stdenv.mkDerivation rec { nlohmann_json boost oneDNN - ]; + ] ++ lib.optionals pythonSupport ([ + flatbuffers + nsync + ] ++ (with python3Packages; [ + numpy + pybind11 + ])); # TODO: build server, and move .so's to lib output - outputs = [ "out" "dev" ]; + outputs = [ "out" "dev" ] ++ lib.optionals pythonSupport [ "python" ]; enableParallelBuilding = true; @@ -79,6 +92,8 @@ stdenv.mkDerivation rec { "-Donnxruntime_USE_MPI=ON" "-Deigen_SOURCE_PATH=${eigen.src}" "-Donnxruntime_USE_DNNL=YES" + ] ++ lib.optionals pythonSupport [ + "-Donnxruntime_ENABLE_PYTHON=ON" ]; doCheck = true; @@ -91,12 +106,18 @@ stdenv.mkDerivation rec { --replace '$'{prefix}/@CMAKE_INSTALL_ @CMAKE_INSTALL_ ''; + postBuild = lib.optionalString pythonSupport '' + ${python3Packages.python.interpreter} ../setup.py bdist_wheel + ''; + postInstall = '' # perform parts of `tools/ci_build/github/linux/copy_strip_binary.sh` install -m644 -Dt $out/include \ ../include/onnxruntime/core/framework/provider_options.h \ ../include/onnxruntime/core/providers/cpu/cpu_provider_factory.h \ ../include/onnxruntime/core/session/onnxruntime_*.h + '' + lib.optionalString pythonSupport '' + pip install dist/*.whl --no-index --no-warn-script-location --prefix="$python" --no-cache --no-deps ''; meta = with lib; { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9a57da598363..f2ce500f8088 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6388,6 +6388,11 @@ in { onnx = callPackage ../development/python-modules/onnx { }; + onnxruntime = (toPythonModule (pkgs.onnxruntime.override { + python3Packages = self; + pythonSupport = true; + })).python; + onvif-zeep-async = callPackage ../development/python-modules/onvif-zeep-async { }; oocsi = callPackage ../development/python-modules/oocsi { }; From 18f7d4c992a49b30d76e459a8639b90521581ca3 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Tue, 27 Sep 2022 13:47:25 +0200 Subject: [PATCH 111/113] python3Packages.onnxconverter-common: init at 1.12.2 --- .../onnxconverter-common/default.nix | 48 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/python-modules/onnxconverter-common/default.nix diff --git a/pkgs/development/python-modules/onnxconverter-common/default.nix b/pkgs/development/python-modules/onnxconverter-common/default.nix new file mode 100644 index 000000000000..89fefb38dee0 --- /dev/null +++ b/pkgs/development/python-modules/onnxconverter-common/default.nix @@ -0,0 +1,48 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, numpy +, packaging +, protobuf +, onnx +, unittestCheckHook +, onnxruntime +}: + +buildPythonPackage { + pname = "onnxconverter-common"; + version = "1.12.2"; # Upstream no longer seems to push tags + + format = "setuptools"; + + src = fetchFromGitHub { + owner = "microsoft"; + repo = "onnxconverter-common"; + rev = "814cdf494d987900d30b16971c0e8334aaca9ae6"; + hash = "sha256-XA/kl8aT1wLthl1bMihtv/1ELOW1sGO/It5XfJtD+sY="; + }; + + propagatedBuildInputs = [ + numpy + packaging # undeclared dependency + protobuf + onnx + ]; + + checkInputs = [ + onnxruntime + unittestCheckHook + ]; + + unittestFlagsArray = [ "-s" "tests" ]; + + # Failing tests + # https://github.com/microsoft/onnxconverter-common/issues/242 + doCheck = false; + + meta = { + description = "ONNX Converter and Optimization Tools"; + maintainers = with lib.maintainers; [ fridh ]; + license = with lib.licenses; [ mit ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f2ce500f8088..e16e0d339f54 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6388,6 +6388,8 @@ in { onnx = callPackage ../development/python-modules/onnx { }; + onnxconverter-common = callPackage ../development/python-modules/onnxconverter-common { }; + onnxruntime = (toPythonModule (pkgs.onnxruntime.override { python3Packages = self; pythonSupport = true; From d5f27c97b835571dc1ab48e1a006f46d01fea7f6 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Tue, 27 Sep 2022 16:05:13 +0200 Subject: [PATCH 112/113] python3Packages.skl2onnx: init at 1.13 --- .../python-modules/skl2onnx/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/python-modules/skl2onnx/default.nix diff --git a/pkgs/development/python-modules/skl2onnx/default.nix b/pkgs/development/python-modules/skl2onnx/default.nix new file mode 100644 index 000000000000..4e8f95863119 --- /dev/null +++ b/pkgs/development/python-modules/skl2onnx/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchPypi +, numpy +, scipy +, protobuf +, onnx +, scikit-learn +, onnxconverter-common +, onnxruntime +, pandas +, unittestCheckHook +}: + +buildPythonPackage rec { + pname = "skl2onnx"; + version = "1.13"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-XzUva5uFX/rGMFpwfwLH1Db0Nok47pBJCSqVo1ZcJz0="; + }; + + propagatedBuildInputs = [ + numpy + scipy + protobuf + onnx + scikit-learn + onnxconverter-common + ]; + + checkInputs = [ + onnxruntime + pandas + unittestCheckHook + ]; + + unittestFlagsArray = [ "-s" "tests" ]; + + # Core dump + doCheck = false; + + meta = { + description = "Convert scikit-learn models to ONNX"; + maintainers = with lib.maintainers; [ fridh ]; + license = with lib.licenses; [ asl20 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e16e0d339f54..617c08bedfbc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10167,6 +10167,8 @@ in { skidl = callPackage ../development/python-modules/skidl { }; + skl2onnx = callPackage ../development/python-modules/skl2onnx { }; + sklearn-deap = callPackage ../development/python-modules/sklearn-deap { }; skodaconnect = callPackage ../development/python-modules/skodaconnect { }; From 46e8398474ac3b1b7bb198bf9097fc213bbf59b1 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 28 Sep 2022 02:13:39 -0700 Subject: [PATCH 113/113] python310Packages.google-cloud-spanner: 3.21.0 -> 3.22.0 (#193252) Co-authored-by: Fabian Affolter --- .../python-modules/google-cloud-spanner/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/google-cloud-spanner/default.nix b/pkgs/development/python-modules/google-cloud-spanner/default.nix index 2b31f280621d..eddd412a4c67 100644 --- a/pkgs/development/python-modules/google-cloud-spanner/default.nix +++ b/pkgs/development/python-modules/google-cloud-spanner/default.nix @@ -10,15 +10,19 @@ , pytestCheckHook , pytest-asyncio , sqlparse +, pythonOlder }: buildPythonPackage rec { pname = "google-cloud-spanner"; - version = "3.21.0"; + version = "3.22.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-47fR2Pwwl9HJ5pIqf8H0QjmrVYy5NgN5sdk3nH4yf/Q="; + hash = "sha256-3EZMUyF9Se+DD3EK0/srYODRJo8OQkAr5RilTbMTHIo="; }; propagatedBuildInputs = [