From e7e3e939a8e9d71e9ec32bc7f3165a311c0a3821 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Tue, 22 Mar 2022 22:49:31 +0000 Subject: [PATCH 01/16] pjsip: add patch for CVE-2022-24764 --- pkgs/applications/networking/pjsip/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/pjsip/default.nix b/pkgs/applications/networking/pjsip/default.nix index 8b0fad83b960..888081374090 100644 --- a/pkgs/applications/networking/pjsip/default.nix +++ b/pkgs/applications/networking/pjsip/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, openssl, libsamplerate, alsa-lib, AppKit }: +{ lib, stdenv, fetchFromGitHub, openssl, libsamplerate, alsa-lib, AppKit, fetchpatch }: stdenv.mkDerivation rec { pname = "pjsip"; @@ -13,6 +13,11 @@ stdenv.mkDerivation rec { patches = [ ./fix-aarch64.patch + (fetchpatch { + name = "CVE-2022-24764.patch"; + url = "https://github.com/pjsip/pjproject/commit/560a1346f87aabe126509bb24930106dea292b00.patch"; + sha256 = "1fy78v3clm0gby7qcq3ny6f7d7f4qnn01lkqq67bf2s85k2phisg"; + }) ]; buildInputs = [ openssl libsamplerate ] From 3689c012135801d5fb48dae93b0731a1ebb389c0 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 13 Apr 2022 03:54:50 +0000 Subject: [PATCH 02/16] cypress: 9.5.3 -> 9.5.4 --- pkgs/development/web/cypress/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/web/cypress/default.nix b/pkgs/development/web/cypress/default.nix index 3d58b865126a..0a726d18b1b4 100644 --- a/pkgs/development/web/cypress/default.nix +++ b/pkgs/development/web/cypress/default.nix @@ -16,11 +16,11 @@ stdenv.mkDerivation rec { pname = "cypress"; - version = "9.5.3"; + version = "9.5.4"; src = fetchzip { url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip"; - sha256 = "qK1TvAGiTVmEQ4MpqICDSP9swnpAcE6iGkGJOrPQ1bI="; + sha256 = "F4BSIA3ImXwmmki8/FK0t08Gf5S8KMpXNNBIPPJQNsM="; }; # don't remove runtime deps From 4f7de0169b89eda49f8aae7a307c9064753b04e0 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 16 Apr 2022 01:27:56 +0000 Subject: [PATCH 03/16] bottles: 2022.4.14-trento -> 2022.4.14-trento-1 --- pkgs/applications/misc/bottles/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/bottles/default.nix b/pkgs/applications/misc/bottles/default.nix index 8898e0fd1d9f..f4e1e50347ac 100644 --- a/pkgs/applications/misc/bottles/default.nix +++ b/pkgs/applications/misc/bottles/default.nix @@ -20,8 +20,8 @@ let in python3Packages.buildPythonApplication rec { pname = "bottles"; - version = "2022.4.14-trento"; - sha256 = "0kjc1w8x4d6g2lx8x8isa2vnwacyjlh9lldf14wn4b118hsw85zs"; + version = "2022.4.14-trento-1"; + sha256 = "16cb01fhxa64f8fadwpr0mawfmchig6xlbx20mz4q9yh5fnagywj"; # Note: Update via pkgs/applications/misc/bottles/update.py # mostly copypasted from pkgs/applications/networking/instant-messengers/telegram/tdesktop/update.py From e77e09c5d2d863d5b0500d08ee6afae7895da723 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 16 Apr 2022 17:17:46 +0200 Subject: [PATCH 04/16] postgresqlTestHook: init --- doc/hooks/index.xml | 10 +++ doc/hooks/postgresql-test-hook.section.md | 59 ++++++++++++++ doc/manual.xml | 1 + .../postgresql-test-hook/default.nix | 9 +++ .../postgresql-test-hook.sh | 79 +++++++++++++++++++ .../setup-hooks/postgresql-test-hook/test.nix | 27 +++++++ pkgs/top-level/all-packages.nix | 2 + 7 files changed, 187 insertions(+) create mode 100644 doc/hooks/index.xml create mode 100644 doc/hooks/postgresql-test-hook.section.md create mode 100644 pkgs/build-support/setup-hooks/postgresql-test-hook/default.nix create mode 100644 pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh create mode 100644 pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix diff --git a/doc/hooks/index.xml b/doc/hooks/index.xml new file mode 100644 index 000000000000..dca07819c623 --- /dev/null +++ b/doc/hooks/index.xml @@ -0,0 +1,10 @@ + + Hooks reference + + Nixpkgs has several hook functions that add augment the stdenv phases. + + + diff --git a/doc/hooks/postgresql-test-hook.section.md b/doc/hooks/postgresql-test-hook.section.md new file mode 100644 index 000000000000..077fac14ebbf --- /dev/null +++ b/doc/hooks/postgresql-test-hook.section.md @@ -0,0 +1,59 @@ + +# `postgresqlTestHook` {#sec-postgresqlTestHook} + +This hook starts a PostgreSQL server during the `checkPhase`. Example: + +```nix +{ stdenv, postgresql, postgresqlTestHook }: +stdenv.mkDerivation { + + # ... + + checkInputs = [ + postgresql + postgresqlTestHook + ]; +} +``` + +If you use a custom `checkPhase`, remember to add the `runHook` calls: +```nix + checkPhase '' + runHook preCheck + + # ... your tests + + runHook postCheck + '' +``` + +## Variables {#sec-postgresqlTestHook-variables} + +The hook logic will read a number of variables and set them to a default value if unset or empty. + +Exported variables: + + - `PGDATA`: location of server files. + - `PGHOST`: location of UNIX domain socket directory; the default `host` in a connection string. + - `PGUSER`: user to create / log in with, default: `test_user`. + - `PGDATABASE`: database name, default: `test_db`. + +Bash-only variables: + + - `postgresqlTestUserOptions`: SQL options to use when creating the `$PGUSER` role, default: `LOGIN`. + - `postgresqlTestSetupSQL`: SQL commands to run as database administrator after startup, default: statements that create `$PGUSER` and `$PGDATABASE`. + - `postgresqlTestSetupCommands`: bash commands to run after database start, defaults to running `$postgresqlTestSetupSQL` as database administrator. + - `postgresqlEnableTCP`: set to `1` to enable TCP listening. Flaky; not recommended. + - `postgresqlStartCommands`: defaults to `pg_ctl start`. + +## TCP and the Nix sandbox {#sec-postgresqlTestHook-tcp} + +`postgresqlEnableTCP` relies on network sandboxing, which is not available on macOS and some custom Nix installations, resulting in flaky tests. +For this reason, it is disabled by default. + +The preferred solution is to make the test suite use a UNIX domain socket connection. This is the default behavior when no `host` connection parameter is provided. +Some test suites hardcode a value for `host` though, so a patch may be required. If you can upstream the patch, you can make `host` default to the `PGHOST` environment variable when set. Otherwise, you can patch it locally to omit the `host` connection string parameter altogether. + +::: {.note} +The error `libpq: failed (could not receive data from server: Connection refused` is generally an indication that the test suite is trying to connect through TCP. +::: diff --git a/doc/manual.xml b/doc/manual.xml index b43021d85ca5..e49ae67ec943 100644 --- a/doc/manual.xml +++ b/doc/manual.xml @@ -27,6 +27,7 @@ + diff --git a/pkgs/build-support/setup-hooks/postgresql-test-hook/default.nix b/pkgs/build-support/setup-hooks/postgresql-test-hook/default.nix new file mode 100644 index 000000000000..d0031c93c10c --- /dev/null +++ b/pkgs/build-support/setup-hooks/postgresql-test-hook/default.nix @@ -0,0 +1,9 @@ +{ callPackage, makeSetupHook }: + +(makeSetupHook { + name = "postgresql-test-hook"; +} ./postgresql-test-hook.sh).overrideAttrs (o: { + passthru.tests = { + simple = callPackage ./test.nix { }; + }; +}) diff --git a/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh b/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh new file mode 100644 index 000000000000..041a3f565332 --- /dev/null +++ b/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh @@ -0,0 +1,79 @@ +preCheckHooks+=('postgresqlStart') +postCheckHooks+=('postgresqlStop') + + +postgresqlStart() { + + # Add default environment variable values + # + # Client variables: + # - https://www.postgresql.org/docs/current/libpq-envars.html + # + # Server variables: + # - only PGDATA: https://www.postgresql.org/docs/current/creating-cluster.html + + if [[ "${PGDATA:-}" == "" ]]; then + PGDATA="$NIX_BUILD_TOP/postgresql" + fi + export PGDATA + + if [[ "${PGHOST:-}" == "" ]]; then + mkdir -p "$NIX_BUILD_TOP/run/postgresql" + PGHOST="$NIX_BUILD_TOP/run/postgresql" + fi + export PGHOST + + if [[ "${PGUSER:-}" == "" ]]; then + PGUSER="test_user" + fi + export PGUSER + + if [[ "${PGDATABASE:-}" == "" ]]; then + PGDATABASE="test_db" + fi + export PGDATABASE + + if [[ "${postgresqlTestUserOptions:-}" == "" ]]; then + postgresqlTestUserOptions="LOGIN" + fi + + if [[ "${postgresqlTestSetupSQL:-}" == "" ]]; then + postgresqlTestSetupSQL="$(cat </dev/null; then + echo >&2 'initdb not found. Did you add postgresql to the checkInputs?' + false + fi + header 'initializing postgresql' + initdb -U postgres + + # Move the socket + echo "unix_socket_directories = '$NIX_BUILD_TOP/run/postgresql'" >>"$PGDATA/postgresql.conf" + + # TCP ports can be a problem in some sandboxes, + # so we disable tcp listening by default + if ! [[ "${postgresqlEnableTCP:-}" = 1 ]]; then + echo "listen_addresses = ''" >>"$PGDATA/postgresql.conf" + fi + + header 'starting postgresql' + eval "${postgresqlStartCommands:-pg_ctl start}" + + header 'setting up postgresql' + eval "$postgresqlTestSetupCommands" + +} + +postgresqlStop() { + header 'stopping postgresql' + pg_ctl stop +} diff --git a/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix b/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix new file mode 100644 index 000000000000..6d8ad6c8c7e3 --- /dev/null +++ b/pkgs/build-support/setup-hooks/postgresql-test-hook/test.nix @@ -0,0 +1,27 @@ +{ postgresql, postgresqlTestHook, stdenv }: + +stdenv.mkDerivation { + name = "postgresql-test-hook-test"; + buildInputs = [ postgresqlTestHook ]; + checkInputs = [ postgresql ]; + dontUnpack = true; + doCheck = true; + passAsFile = ["sql"]; + sql = '' + CREATE TABLE hello ( + message text + ); + INSERT INTO hello VALUES ('it '||'worked'); + SELECT * FROM hello; + ''; + checkPhase = '' + runHook preCheck + psql <$sqlPath | grep 'it worked' + TEST_RAN=1 + runHook postCheck + ''; + installPhase = '' + [[ $TEST_RAN == 1 ]] + touch $out + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 615bf750169f..12bec9613e6d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21965,6 +21965,8 @@ with pkgs; postgresql_jdbc = callPackage ../development/java-modules/postgresql_jdbc { }; + postgresqlTestHook = callPackage ../build-support/setup-hooks/postgresql-test-hook { }; + prom2json = callPackage ../servers/monitoring/prometheus/prom2json.nix { }; prometheus = callPackage ../servers/monitoring/prometheus { }; prometheus-alertmanager = callPackage ../servers/monitoring/prometheus/alertmanager.nix { }; From 5388103926de037277e80b48cf7e0221bbb56cbe Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 16 Apr 2022 17:19:13 +0200 Subject: [PATCH 05/16] haskellPackages.pg-client: Enable tests --- .../development/haskell-modules/configuration-common.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 7bc823b3e84c..968a83ec50fa 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1515,8 +1515,13 @@ self: super: { }; pg-client = overrideCabal (drv: { librarySystemDepends = with pkgs; [ postgresql krb5.dev openssl.dev ]; - # wants a running DB to check against - doCheck = false; + testToolDepends = drv.testToolDepends or [] ++ [ + pkgs.postgresql pkgs.postgresqlTestHook + ]; + preCheck = drv.preCheck or "" + '' + # empty string means use default connection + export DATABASE_URL="" + ''; }) (super.pg-client.override { resource-pool = self.hasura-resource-pool; ekg-core = self.hasura-ekg-core; From ebf1ce192388b5588e1a206579d9678a93fad65e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 16 Apr 2022 17:33:47 +0200 Subject: [PATCH 06/16] nixos/doc/rl-2205: Add `postgresqlTestHook` --- nixos/doc/manual/from_md/release-notes/rl-2205.section.xml | 7 +++++++ nixos/doc/manual/release-notes/rl-2205.section.md | 2 ++ 2 files changed, 9 insertions(+) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml index 33b0b3faea6f..b6e6109fc6be 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml @@ -73,6 +73,13 @@ Systemd has been upgraded to the version 250. + + + The new + postgresqlTestHook + runs a PostgreSQL server for the duration of package checks. + + kops diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md index a671f08acfd9..a7254ba23bc3 100644 --- a/nixos/doc/manual/release-notes/rl-2205.section.md +++ b/nixos/doc/manual/release-notes/rl-2205.section.md @@ -27,6 +27,8 @@ In addition to numerous new and upgraded packages, this release has the followin - Systemd has been upgraded to the version 250. +- The new [`postgresqlTestHook`](https://nixos.org/manual/nixpkgs/stable/#sec-postgresqlTestHook) runs a PostgreSQL server for the duration of package checks. + - [`kops`](https://kops.sigs.k8s.io) defaults to 1.22.4, which will enable [Instance Metadata Service Version 2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html) and require tokens on new clusters with Kubernetes 1.22. This will increase security by default, but may break some types of workloads. See the [release notes](https://kops.sigs.k8s.io/releases/1.22-notes/) for details. - Module authors can use `mkRenamedOptionModuleWith` to automate the deprecation cycle without annoying out-of-tree module authors and their users. From b4b53283896327360ecf4bcc5ae8c87212ca3ed0 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 16 Apr 2022 17:37:13 +0200 Subject: [PATCH 07/16] haskellPackages.esqueleto: Enable tests --- .../haskell-modules/configuration-common.nix | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 968a83ec50fa..0bff301224c8 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1190,8 +1190,29 @@ self: super: { # Fix build with attr-2.4.48 (see #53716) xattr = appendPatch ./patches/xattr-fix-build.patch super.xattr; - # Some tests depend on a postgresql instance - esqueleto = dontCheck super.esqueleto; + esqueleto = + overrideCabal + (drv: { + postPatch = drv.postPatch or "" + '' + # patch out TCP usage: https://nixos.org/manual/nixpkgs/stable/#sec-postgresqlTestHook-tcp + sed -i test/PostgreSQL/Test.hs \ + -e s^host=localhost^^ + ''; + # Match the test suite defaults (or hardcoded values?) + preCheck = drv.preCheck or "" + '' + PGUSER=esqutest + PGDATABASE=esqutest + ''; + testFlags = drv.testFlags or [] ++ [ + # We don't have a MySQL test hook yet + "--skip=/Esqueleto/MySQL" + ]; + testToolDepends = drv.testToolDepends or [] ++ [ + pkgs.postgresql + pkgs.postgresqlTestHook + ]; + }) + super.esqueleto; # Requires API keys to run tests algolia = dontCheck super.algolia; From f60768b6cda4e48c1905649868592c7b080fa355 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 16 Apr 2022 17:39:19 +0200 Subject: [PATCH 08/16] haskellPackages.persistent-postgresql: Enable tests --- .../haskell-modules/configuration-common.nix | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 0bff301224c8..66bd34bdbc07 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1331,7 +1331,25 @@ self: super: { # Test suite requires database persistent-mysql = dontCheck super.persistent-mysql; - persistent-postgresql = dontCheck super.persistent-postgresql; + persistent-postgresql = + overrideCabal + (drv: { + postPatch = drv.postPath or "" + '' + # patch out TCP usage: https://nixos.org/manual/nixpkgs/stable/#sec-postgresqlTestHook-tcp + # NOTE: upstream host variable takes only two values... + sed -i test/PgInit.hs \ + -e s^'host=" <> host <> "'^^ + ''; + preCheck = drv.preCheck or "" + '' + PGDATABASE=test + PGUSER=test + ''; + testToolDepends = drv.testToolDepends or [] ++ [ + pkgs.postgresql + pkgs.postgresqlTestHook + ]; + }) + super.persistent-postgresql; # Fix EdisonAPI and EdisonCore for GHC 8.8: # https://github.com/robdockins/edison/pull/16 From 30a00c29c4b0be54cee6f8bcfb2fdde583454407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Fri, 15 Apr 2022 11:23:02 +0100 Subject: [PATCH 09/16] nixos/systemd: Properly shut down the system --- .../from_md/release-notes/rl-2205.section.xml | 8 +++++ .../manual/release-notes/rl-2205.section.md | 2 ++ nixos/modules/module-list.nix | 1 + .../modules/system/boot/systemd/shutdown.nix | 32 +++++++++++++++++++ nixos/tests/all-tests.nix | 2 ++ nixos/tests/systemd-shutdown.nix | 21 ++++++++++++ 6 files changed, 66 insertions(+) create mode 100644 nixos/modules/system/boot/systemd/shutdown.nix create mode 100644 nixos/tests/systemd-shutdown.nix diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml index 86e952ae70c8..4c1f85cc7920 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml @@ -1184,6 +1184,14 @@ systemd.nspawn.<name>.execConfig.PrivateUsers = false + + + systemd-shutdown is now properly linked on + shutdown to unmount all filesystems and device mapper devices + cleanly. This can be disabled using + boot.systemd.shutdown.enable. + + The Tor SOCKS proxy is now actually disabled if diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md index 68ca9a6c3c84..4b57b1be0354 100644 --- a/nixos/doc/manual/release-notes/rl-2205.section.md +++ b/nixos/doc/manual/release-notes/rl-2205.section.md @@ -455,6 +455,8 @@ In addition to numerous new and upgraded packages, this release has the followin - `systemd-nspawn@.service` settings have been reverted to the default systemd behaviour. User namespaces are now activated by default. If you want to keep running nspawn containers without user namespaces you need to set `systemd.nspawn..execConfig.PrivateUsers = false` +- `systemd-shutdown` is now properly linked on shutdown to unmount all filesystems and device mapper devices cleanly. This can be disabled using `boot.systemd.shutdown.enable`. + - The Tor SOCKS proxy is now actually disabled if `services.tor.client.enable` is set to `false` (the default). If you are using this functionality but didn't change the setting or set it to `false`, you now need to set it to `true`. - The terraform 0.12 compatibility has been removed and the `terraform.withPlugins` and `terraform-providers.mkProvider` implementations simplified. Providers now need to be stored under diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 05cef36c7820..515e6b6b0f70 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1184,6 +1184,7 @@ ./system/boot/systemd/journald.nix ./system/boot/systemd/logind.nix ./system/boot/systemd/nspawn.nix + ./system/boot/systemd/shutdown.nix ./system/boot/systemd/tmpfiles.nix ./system/boot/systemd/user.nix ./system/boot/systemd/initrd.nix diff --git a/nixos/modules/system/boot/systemd/shutdown.nix b/nixos/modules/system/boot/systemd/shutdown.nix new file mode 100644 index 000000000000..934269316676 --- /dev/null +++ b/nixos/modules/system/boot/systemd/shutdown.nix @@ -0,0 +1,32 @@ +{ config, lib, ... }: let + + cfg = config.boot.systemd.shutdown; + +in { + options.boot.systemd.shutdown = { + enable = lib.mkEnableOption "pivoting back to an initramfs for shutdown" // { default = true; }; + }; + + config = lib.mkIf cfg.enable { + systemd.services.generate-shutdown-ramfs = { + description = "Generate shutdown ramfs"; + before = [ "shutdown.target" ]; + unitConfig = { + DefaultDependencies = false; + ConditionFileIsExecutable = [ + "!/run/initramfs/shutdown" + "/run/current-system/systemd/lib/systemd/systemd-shutdown" + ]; + }; + + serviceConfig.Type = "oneshot"; + script = '' + mkdir -p /run/initramfs + if ! mountpoint -q /run/initramfs; then + mount -t tmpfs tmpfs /run/initramfs + fi + cp /run/current-system/systemd/lib/systemd/systemd-shutdown /run/initramfs/shutdown + ''; + }; + }; +} diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index cb68ef685300..e4ea75c5db81 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -521,6 +521,7 @@ in systemd-confinement = handleTest ./systemd-confinement.nix {}; systemd-cryptenroll = handleTest ./systemd-cryptenroll.nix {}; systemd-escaping = handleTest ./systemd-escaping.nix {}; + systemd-initrd-shutdown = handleTest ./systemd-shutdown.nix { systemdStage1 = true; }; systemd-initrd-simple = handleTest ./systemd-initrd-simple.nix {}; systemd-initrd-swraid = handleTest ./systemd-initrd-swraid.nix {}; systemd-journal = handleTest ./systemd-journal.nix {}; @@ -531,6 +532,7 @@ in systemd-networkd-ipv6-prefix-delegation = handleTest ./systemd-networkd-ipv6-prefix-delegation.nix {}; systemd-networkd-vrf = handleTest ./systemd-networkd-vrf.nix {}; systemd-nspawn = handleTest ./systemd-nspawn.nix {}; + systemd-shutdown = handleTest ./systemd-shutdown.nix {}; systemd-timesyncd = handleTest ./systemd-timesyncd.nix {}; systemd-misc = handleTest ./systemd-misc.nix {}; taskserver = handleTest ./taskserver.nix {}; diff --git a/nixos/tests/systemd-shutdown.nix b/nixos/tests/systemd-shutdown.nix new file mode 100644 index 000000000000..9283489c2559 --- /dev/null +++ b/nixos/tests/systemd-shutdown.nix @@ -0,0 +1,21 @@ +import ./make-test-python.nix ({ pkgs, systemdStage1 ? false, ...} : { + name = "systemd-shutdown"; + meta = with pkgs.lib.maintainers; { + maintainers = [ das_j ]; + }; + + nodes.machine = { + imports = [ ../modules/profiles/minimal.nix ]; + boot.initrd.systemd.enable = systemdStage1; + }; + + testScript = '' + machine.wait_for_unit("multi-user.target") + # .shutdown() would wait for the machine to power off + machine.succeed("systemctl poweroff") + # Message printed by systemd-shutdown + machine.wait_for_console_text("All filesystems, swaps, loop devices, MD devices and DM devices detached.") + # Don't try to sync filesystems + machine.booted = False + ''; +}) From 2acbc3d8525706135513397ca139b8290a90f5ad Mon Sep 17 00:00:00 2001 From: Reno Reckling Date: Sun, 17 Apr 2022 01:33:58 +0200 Subject: [PATCH 10/16] qpwgraph: 0.2.2 -> 0.2.5 --- pkgs/applications/audio/qpwgraph/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/qpwgraph/default.nix b/pkgs/applications/audio/qpwgraph/default.nix index 860eca652e7a..9d5c3dead037 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.2.2"; + version = "0.2.5"; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; owner = "rncbc"; repo = "qpwgraph"; rev = "v${version}"; - sha256 = "sha256-BBvF1L3IqkYqSghHxcbwOBizdu6GtxaWof3Q/bc+aTY="; + sha256 = "sha256-OYIBlTO1vXmmY4/ZacvsEQ5EnOfetBvnG2v5xL44czY="; }; nativeBuildInputs = [ cmake pkg-config ]; From 9ca25256765a992cea8120f0e020854cb83197c8 Mon Sep 17 00:00:00 2001 From: Reno Reckling Date: Sun, 17 Apr 2022 19:40:22 +0200 Subject: [PATCH 11/16] Add exi as maintainer for qpwgraph It might be that the current maintainer is in a war. --- pkgs/applications/audio/qpwgraph/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/audio/qpwgraph/default.nix b/pkgs/applications/audio/qpwgraph/default.nix index 9d5c3dead037..e415798b4604 100644 --- a/pkgs/applications/audio/qpwgraph/default.nix +++ b/pkgs/applications/audio/qpwgraph/default.nix @@ -29,6 +29,6 @@ mkDerivation rec { homepage = "https://gitlab.freedesktop.org/rncbc/qpwgraph"; license = licenses.gpl2Plus; platforms = platforms.linux; - maintainers = with maintainers; [ kanashimia ]; + maintainers = with maintainers; [ kanashimia exi ]; }; } From b5f6673f097681d3287a842fccf3198518bbf17d Mon Sep 17 00:00:00 2001 From: Philipp Woelfel Date: Sun, 17 Apr 2022 18:41:58 -0600 Subject: [PATCH 12/16] pdfstudio: 2021.1.2 -> 2021.1.3 --- pkgs/applications/misc/pdfstudio/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/pdfstudio/default.nix b/pkgs/applications/misc/pdfstudio/default.nix index c91f6f64cf74..e27519da2cd7 100644 --- a/pkgs/applications/misc/pdfstudio/default.nix +++ b/pkgs/applications/misc/pdfstudio/default.nix @@ -12,7 +12,7 @@ in pdfstudio = callPackage ./common.nix rec { pname = program; year = "2021"; - version = "${year}.1.2"; + version = "${year}.1.3"; desktopName = "PDF Studio"; longDescription = '' PDF Studio is an easy to use, full-featured PDF editing software. This is the standard/pro edition, which requires a license. For the free PDF Studio Viewer see the package pdfstudioviewer. @@ -22,21 +22,21 @@ in ]; src = fetchurl { url = makeurl { inherit pname year version; }; - sha256 = "1188ll2qz58rr2slavqxisbz4q3fdzidpasb1p33926z0ym3rk45"; + sha256 = "sha256-2az8/slWeLY7l7dCwyTaT18KFfvsO71vJFDZEvbDHGM="; }; }; pdfstudioviewer = callPackage ./common.nix rec { pname = program; year = "2021"; - version = "${year}.1.2"; + version = "${year}.1.3"; desktopName = "PDF Studio Viewer"; longDescription = '' PDF Studio Viewer is an easy to use, full-featured PDF editing software. This is the free edition. For the standard/pro edition, see the package pdfstudio. ''; src = fetchurl { url = makeurl { inherit pname year version; }; - sha256 = "128k3fm8m8zdykx4s30g5m2zl7cgmvs4qinf1w525zh84v56agz6"; + sha256 = "sha256-kd+rQruBL0fudmc30agRO/XV97l/6unqU0GK25yhOzI="; }; }; }.${program} From 355b60dd6c7852586cbae98f86f8d28007b234fb Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 18 Apr 2022 02:39:28 +0000 Subject: [PATCH 13/16] ffmpeg-normalize: 1.22.8 -> 1.22.9 --- pkgs/applications/video/ffmpeg-normalize/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/video/ffmpeg-normalize/default.nix b/pkgs/applications/video/ffmpeg-normalize/default.nix index a2f802c6e87b..9331471c747e 100644 --- a/pkgs/applications/video/ffmpeg-normalize/default.nix +++ b/pkgs/applications/video/ffmpeg-normalize/default.nix @@ -7,11 +7,11 @@ buildPythonApplication rec { pname = "ffmpeg-normalize"; - version = "1.22.8"; + version = "1.22.9"; src = fetchPypi { inherit pname version; - sha256 = "sha256-vxiq6q8fPh8ZLKnxYdIN591UQW73FWsoke1PvKTkko8="; + sha256 = "sha256-RBrCIDinPXbXKqrrhqVf3rV4rfi+2PttIaYxUKOk7hs="; }; propagatedBuildInputs = [ ffmpeg ffmpeg-progress-yield ]; From 980b1ba32b978d30eaf115c62f9d90d1cf075c3c Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Mon, 18 Apr 2022 07:35:21 +0300 Subject: [PATCH 14/16] =?UTF-8?q?josm:=2018387=20=E2=86=92=2018427?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/applications/misc/josm/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/josm/default.nix b/pkgs/applications/misc/josm/default.nix index cc6d4e33fb24..9a7ed898e51f 100644 --- a/pkgs/applications/misc/josm/default.nix +++ b/pkgs/applications/misc/josm/default.nix @@ -3,20 +3,20 @@ }: let pname = "josm"; - version = "18387"; + version = "18427"; srcs = { jar = fetchurl { url = "https://josm.openstreetmap.de/download/josm-snapshot-${version}.jar"; - sha256 = "sha256-zkEWZjjSy0ajG5X1/dIgLPZ7zr0BiaJJcHaN8sv/3yc="; + sha256 = "sha256-SsoeKfpWi41sd77LfaQW0OcHnyf8iLolKWF74dhalpY="; }; macosx = fetchurl { url = "https://josm.openstreetmap.de/download/macosx/josm-macos-${version}-java17.zip"; - sha256 = "sha256-xOVnnQ+eUkboT8Tq5F4QJEou1wAaHwiEdyiEKDR/fUk="; + sha256 = "sha256-cz3OT03StvJy9XYBiPxx+nz36O0cg+XrL/uc52/G/1c="; }; pkg = fetchsvn { url = "https://josm.openstreetmap.de/svn/trunk/native/linux/tested"; rev = version; - sha256 = "sha256-GbIWZTJmmUT8r9L63/6mcnRt7dvavqGAVbozxlbF89g="; + sha256 = "sha256-AyfUFE0y8d8FtgfhxSscQGE1IVNwYYNymH6jTnrUBTs="; }; }; in From 9233d3357911600683263a64cf346e84d5ac07c5 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Mon, 18 Apr 2022 17:14:55 +1000 Subject: [PATCH 15/16] pkgs-lib.formats: fix tomlkit output --- pkgs/pkgs-lib/tests/formats.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/pkgs-lib/tests/formats.nix b/pkgs/pkgs-lib/tests/formats.nix index 6ace13044b4c..aa51e2c5842b 100644 --- a/pkgs/pkgs-lib/tests/formats.nix +++ b/pkgs/pkgs-lib/tests/formats.nix @@ -165,6 +165,7 @@ in runBuildTests { [attrs] foo = "foo" + [level1.level2.level3] level4 = "deep" ''; From 99fed858bbb77490a70a3e33713b66b4ccae1b03 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 18 Apr 2022 11:57:35 +0200 Subject: [PATCH 16/16] doc/hooks/index.xml: Fix typo and terminology --- doc/hooks/index.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/hooks/index.xml b/doc/hooks/index.xml index dca07819c623..6a046eae2885 100644 --- a/doc/hooks/index.xml +++ b/doc/hooks/index.xml @@ -4,7 +4,7 @@ xml:id="chap-hooks"> Hooks reference - Nixpkgs has several hook functions that add augment the stdenv phases. + Nixpkgs has several hook packages that augment the stdenv phases.