From 663b3d4be79ebb31ab277a55c0fe4b975cfa17c2 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 28 Feb 2024 16:22:34 +0100 Subject: [PATCH] nixops_unstable*: Make withPlugins.*.tests.nixos behave correctly --- nixos/tests/nixops/default.nix | 2 +- .../applications/networking/cluster/nixops/default.nix | 10 ++++++++-- .../networking/cluster/nixops/unwrapped.nix | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/nixos/tests/nixops/default.nix b/nixos/tests/nixops/default.nix index 6501d13a2ed3..acfe6feee9d1 100644 --- a/nixos/tests/nixops/default.nix +++ b/nixos/tests/nixops/default.nix @@ -9,7 +9,7 @@ let # - Alternatively, blocked on a NixOps 2 release # https://github.com/NixOS/nixops/issues/1242 # stable = testsLegacyNetwork { nixopsPkg = pkgs.nixops; }; - unstable = testsForPackage { nixopsPkg = pkgs.nixops_unstable; }; + unstable = testsForPackage { nixopsPkg = pkgs.nixops_unstable_minimal; }; # inherit testsForPackage; }; diff --git a/pkgs/applications/networking/cluster/nixops/default.nix b/pkgs/applications/networking/cluster/nixops/default.nix index da9783b9a6eb..6bdbebb8eb6d 100644 --- a/pkgs/applications/networking/cluster/nixops/default.nix +++ b/pkgs/applications/networking/cluster/nixops/default.nix @@ -28,8 +28,8 @@ let # selector is a function mapping pythonPackages to a list of plugins # e.g. nixops_unstable.withPlugins (ps: with ps; [ nixops-aws ]) withPlugins = selector: let - selected = selector (plugins python.pkgs); - in python.pkgs.toPythonApplication (python.pkgs.nixops.overridePythonAttrs (old: { + selected = selector (plugins python.pkgs); + r = python.pkgs.toPythonApplication (python.pkgs.nixops.overridePythonAttrs (old: { propagatedBuildInputs = old.propagatedBuildInputs ++ selected; # Propagating dependencies leaks them through $PYTHONPATH which causes issues @@ -41,8 +41,14 @@ let passthru = old.passthru // { plugins = plugins python.pkgs; inherit withPlugins python; + tests = old.passthru.tests // { + nixos = old.passthru.tests.nixos.passthru.override { + nixopsPkg = r; + }; + }; }; })); + in r; in { nixops_unstable_minimal = withPlugins (ps: []); diff --git a/pkgs/applications/networking/cluster/nixops/unwrapped.nix b/pkgs/applications/networking/cluster/nixops/unwrapped.nix index 34cbf0949154..058f7f2d2c1c 100644 --- a/pkgs/applications/networking/cluster/nixops/unwrapped.nix +++ b/pkgs/applications/networking/cluster/nixops/unwrapped.nix @@ -50,7 +50,7 @@ buildPythonApplication rec { pythonImportsCheck = [ "nixops" ]; passthru = { - tests.nixops = nixosTests.nixops.unstable; + tests.nixos = nixosTests.nixops.unstable; updateScript = unstableGitUpdater {}; };