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/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/modules.nix b/lib/modules.nix index b6751d17f8f4..46e22088a204 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/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"; 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" ]; + } + ]; +} diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index d61bbaddf764..ecd62eb4e848 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 { @@ -36,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" '' @@ -50,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/running-nixos-tests-interactively.section.md b/nixos/doc/manual/development/running-nixos-tests-interactively.section.md index a1431859ff59..d9c316f4b139 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,15 @@ $ ./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} + +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/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/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md index 6934bb0face7..99704ec3c141 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,10 +21,13 @@ 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.`](#opt-nodes) are NixOS modules themselves. + +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). @@ -34,7 +37,54 @@ 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 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} + +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`. + +```nix + hostname = runTest { + imports = [ ./hostname.nix ]; + defaults.networking.firewall.enable = false; + }; +``` + +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.hostname +``` + +### Testing outside the NixOS project {#sec-call-nixos-test-outside-nixos} + +Outside the `nixpkgs` repository, you can instantiate the test by first importing the NixOS library, + +```nix +let nixos-lib = import (nixpkgs + "/nixos/lib") { }; +in + +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` @@ -121,7 +171,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` @@ -130,7 +180,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` @@ -241,7 +291,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` @@ -304,7 +354,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 +386,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 +450,6 @@ added using the parameter `extraPythonPackages`. For example, you could add `numpy` like this: ```nix -import ./make-test-python.nix { extraPythonPackages = p: [ p.numpy ]; @@ -417,3 +466,11 @@ import ./make-test-python.nix ``` 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/running-nixos-tests-interactively.section.xml b/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml index 0e47350a0d24..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 @@ -25,15 +25,40 @@ $ ./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 + + 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/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 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..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 @@ -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,10 +22,18 @@ import ./make-test-python.nix { } - The attribute 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. + We refer to the whole test above as a test module, whereas the + values in + nodes.<name> + are NixOS modules themselves. + + + 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 @@ -38,78 +46,138 @@ 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 differently depending on whether the test is + part of NixOS or lives in a different project. + +
+ Testing within NixOS + + 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. + + + hostname = runTest { + imports = [ ./hostname.nix ]; + defaults.networking.firewall.enable = false; + }; + + + 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.hostname + +
+
+ Testing outside the NixOS project + + Outside the nixpkgs repository, you can + instantiate the test by first importing the NixOS library, + + +let nixos-lib = import (nixpkgs + "/nixos/lib") { }; +in + +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 @@ -194,8 +262,9 @@ start_all() - This requires passing enableOCR to the - test attribute set. + This requires + enableOCR + to be set to true. @@ -211,8 +280,9 @@ start_all() - This requires passing enableOCR to the - test attribute set. + This requires + enableOCR + to be set to true. @@ -451,8 +521,9 @@ start_all() - This requires passing enableOCR to the - test attribute set. + This requires + enableOCR + to be set to true. @@ -563,7 +634,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 +666,7 @@ import ./make-test-python.nix { the following way: -import ./make-test-python.nix { +{ skipTypeCheck = true; nodes.machine = { config, pkgs, ... }: @@ -669,7 +740,6 @@ def foo_running(): numpy like this: -import ./make-test-python.nix { extraPythonPackages = p: [ p.numpy ]; @@ -689,4 +759,11 @@ import ./make-test-python.nix python3Packages.
+
+ Test Options Reference + + The following options can be used when writing tests. + + +
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_; - -} 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/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 ? {} diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index 4bb1689ffd78..c303b0bf17bc 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -12,159 +12,22 @@ with pkgs; +let + nixos-lib = import ./default.nix { inherit (pkgs) lib; }; +in + 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}"; + evalTest = module: nixos-lib.evalTest { imports = [ extraTestModule module ]; }; + runTest = module: nixos-lib.runTest { imports = [ extraTestModule module ]; }; - 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 + extraTestModule = { + config = { + hostPkgs = pkgs; }; - - # 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"} - ''); + }; # Make a full-blown test makeTest = @@ -184,90 +47,19 @@ rec { then builtins.unsafeGetAttrPos "description" meta else builtins.unsafeGetAttrPos "testScript" t) , extraPythonPackages ? (_ : []) + , interactive ? {} } @ 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/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/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; +} diff --git a/nixos/lib/testing/driver.nix b/nixos/lib/testing/driver.nix new file mode 100644 index 000000000000..04e99f9e21d6 --- /dev/null +++ b/nixos/lib/testing/driver.nix @@ -0,0 +1,188 @@ +{ config, lib, hostPkgs, ... }: +let + 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 + 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 ]; + buildInputs = [ testDriver ]; + 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 + + 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 (!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 = mdDoc "Package containing a script that runs the test."; + type = types.package; + defaultText = literalMD "set by the test framework"; + }; + + hostPkgs = mkOption { + description = mdDoc "Nixpkgs attrset used outside the nodes."; + type = types.raw; + example = lib.literalExpression '' + import nixpkgs { inherit system config overlays; } + ''; + }; + + qemu.package = mkOption { + 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 = mdDoc '' + Whether to enable Optical Character Recognition functionality for + testing graphical programs. See [Machine objects](`ssec-machine-objects`). + ''; + type = types.bool; + default = false; + }; + + extraPythonPackages = mkOption { + 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 = 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 = []; + }; + + 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). + ''; + }; + }; + + 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..317ed4241882 --- /dev/null +++ b/nixos/lib/testing/interactive.nix @@ -0,0 +1,45 @@ +{ config, lib, moduleType, hostPkgs, ... }: +let + inherit (lib) mkOption types mdDoc; +in +{ + options = { + interactive = mkOption { + description = mdDoc '' + 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"; + }; + }; + + 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..4d8b0e0f1c43 --- /dev/null +++ b/nixos/lib/testing/meta.nix @@ -0,0 +1,42 @@ +{ lib, ... }: +let + 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; # 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. + ''; + }; + }; + }; + default = {}; + }; + }; +} diff --git a/nixos/lib/testing/name.nix b/nixos/lib/testing/name.nix new file mode 100644 index 000000000000..a54622e139bf --- /dev/null +++ b/nixos/lib/testing/name.nix @@ -0,0 +1,14 @@ +{ lib, ... }: +let + inherit (lib) mkOption types mdDoc; +in +{ + 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 new file mode 100644 index 000000000000..04ea9a2bc9f7 --- /dev/null +++ b/nixos/lib/testing/network.nix @@ -0,0 +1,117 @@ +{ lib, nodes, ... }: + +let + inherit (lib) + attrNames concatMap concatMapStrings flip forEach head + listToAttrs mkDefault mkOption nameValuePair optionalString + range types zipListsWith zipLists + mdDoc + ; + + nodeNumbers = + listToAttrs + (zipListsWith + nameValuePair + (attrNames nodes) + (range 1 254) + ); + + 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 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 = mdDoc '' + 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 = mdDoc '' + 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.submoduleWith { + modules = [ + { + config.virtualisation.test.nodeName = + # assert regular.config.virtualisation.test.nodeName != "configuration"; + regular.config.virtualisation.test.nodeName; + } + ]; + }; + }; + }); + }; + }; + }); + +in +{ + config = { + extraBaseModules = { imports = [ networkModule nodeNumberModule ]; }; + }; +} 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 new file mode 100644 index 000000000000..765af2878dfe --- /dev/null +++ b/nixos/lib/testing/nodes.nix @@ -0,0 +1,112 @@ +testModuleArgs@{ config, lib, hostPkgs, nodes, ... }: + +let + inherit (lib) mkOption mkForce optional types mapAttrs mkDefault mdDoc; + + 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) ++ + [ + ./nixos-test-base.nix + { key = "nodes"; _module.args.nodes = config.nodesCompat; } + ({ 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; + }) + testModuleArgs.config.extraBaseModules + ] ++ 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; + 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 = 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 = { }; + }; + + 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. + ''; + }; + }; + + 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/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/lib/testing/run.nix b/nixos/lib/testing/run.nix new file mode 100644 index 000000000000..0cd07d8afd21 --- /dev/null +++ b/nixos/lib/testing/run.nix @@ -0,0 +1,57 @@ +{ config, hostPkgs, lib, ... }: +let + inherit (lib) types mkOption mdDoc; +in +{ + options = { + passthru = mkOption { + type = types.lazyAttrsOf types.raw; + description = mdDoc '' + 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. + ''; + }; + + test = mkOption { + type = types.package; + # 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. + ''; + }; + }; + + config = { + 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" ]; + + 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; + }; + inherit (config) passthru 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..5d4181c5f5dd --- /dev/null +++ b/nixos/lib/testing/testScript.nix @@ -0,0 +1,84 @@ +testModuleArgs@{ config, lib, hostPkgs, nodes, moduleType, ... }: +let + 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; + readOnly = true; + internal = true; + }; + + includeTestScriptReferences = mkOption { + type = types.bool; + default = true; + internal = true; + }; + withoutTestScriptReferences = mkOption { + type = moduleType; + description = mdDoc '' + A parallel universe where the testScript is invalid and has no references. + ''; + internal = true; + visible = false; + }; + }; + 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); + }; + }; +} 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 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/3proxy.nix b/nixos/tests/3proxy.nix index 8127438fabd9..647d9d57c7ff 100644 --- a/nixos/tests/3proxy.nix +++ b/nixos/tests/3proxy.nix @@ -1,6 +1,6 @@ -import ./make-test-python.nix ({ pkgs, ...} : { +{ lib, pkgs, ... }: { name = "3proxy"; - meta = with pkgs.lib.maintainers; { + meta = with lib.maintainers; { maintainers = [ misuzu ]; }; @@ -92,7 +92,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { networking.firewall.allowedTCPPorts = [ 3128 9999 ]; }; - peer3 = { lib, ... }: { + peer3 = { lib, pkgs, ... }: { networking.useDHCP = false; networking.interfaces.eth1 = { ipv4.addresses = [ @@ -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/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/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/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 5ea2c94ccb1c..a4ade096ef8c 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 @@ -11,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: @@ -27,12 +43,34 @@ let }; evalMinimalConfig = module: nixosLib.evalModules { modules = [ module ]; }; + inherit + (rec { + 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 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 {}; - adguardhome = handleTest ./adguardhome.nix {}; - aesmd = handleTest ./aesmd.nix {}; - agate = handleTest ./web-servers/agate.nix {}; + _3proxy = runTest ./3proxy.nix; + acme = runTest ./acme.nix; + adguardhome = runTest ./adguardhome.nix; + aesmd = runTest ./aesmd.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/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 # ]; # }; # 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/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 = { 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/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 = { ... }: { diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index 8bef4fad3dd2..d9f64a781c57 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,13 @@ let perlPackages.ListCompare perlPackages.XMLLibXML python3Minimal + # 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 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/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 + ''; +} 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. 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 ]; 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 ]; 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 ]; 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 = [ 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'; 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; }; 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}" ]; 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 = '' 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 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 = [ 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 ]; 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 = [ 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="; 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 = [ diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix index 41be39ee131a..68a6b4f6bbe3 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 @@ -51,7 +51,7 @@ let optipng pngquant qpdf - tesseract4 + tesseract5 unpaper ]; in 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 ]; 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}" 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)" \ 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 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/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 = { 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"; }; }; 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/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 = [ 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 = [ 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 = [ 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 = [ 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 = [ 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 = [ 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 = [ diff --git a/pkgs/development/python-modules/dnslib/default.nix b/pkgs/development/python-modules/dnslib/default.nix index 2d70c00579eb..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.21"; + version = "0.9.22"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-IXabARWP5wvokSF1Q0nyg13M3yHVwBHOyfoopI+lVdQ="; + 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 ]; }; } 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 = [ 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 = '' diff --git a/pkgs/development/python-modules/hmmlearn/default.nix b/pkgs/development/python-modules/hmmlearn/default.nix index 8c699af97526..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.7"; + version = "0.2.8"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; src = fetchurl { url = "mirror://pypi/h/hmmlearn/${pname}-${version}.tar.gz"; - sha256 = "sha256-a0snIPJ6912pNnq02Q3LAPONozFo322Rf57F3mZw9uE="; + 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 ]; }; } 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 = [ 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 = [ 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 ]; 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 = [ 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 = [ 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 = [ 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 = [ 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/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/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 = [ 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 ]; 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"; 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 = '' 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 = [ 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 = [ 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 = [ 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 = [ 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; 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 ''; } 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/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; 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 = [ 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 = [ 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; [ 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 ]; 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. 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; 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 = [ 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" ]; 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"; 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; 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; 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"; 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/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="; 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="; 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="; 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/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 ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ba90a7dd796d..a4920769fdb2 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; }; }; @@ -2092,6 +2092,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 {}; @@ -2366,6 +2370,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 { }; @@ -17393,6 +17399,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 { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c9f094990292..617c08bedfbc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6344,7 +6344,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 { }; @@ -6386,6 +6388,13 @@ in { onnx = callPackage ../development/python-modules/onnx { }; + onnxconverter-common = callPackage ../development/python-modules/onnxconverter-common { }; + + 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 { }; @@ -10158,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 { };