From 8d9f5ca31a0315c99584dc3d0d642354ca1c67aa Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 28 Feb 2024 16:29:27 +0100 Subject: [PATCH] nixops_unstable_*: Memoize availablePlugins --- pkgs/applications/networking/cluster/nixops/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/cluster/nixops/default.nix b/pkgs/applications/networking/cluster/nixops/default.nix index 6bdbebb8eb6d..abaa62a8bfdb 100644 --- a/pkgs/applications/networking/cluster/nixops/default.nix +++ b/pkgs/applications/networking/cluster/nixops/default.nix @@ -25,10 +25,12 @@ let nixopsvbox = nixops-vbox; }; + withPlugins = withPlugins' { availablePlugins = plugins python.pkgs; }; + # 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); + withPlugins' = { availablePlugins }: selector: let + selected = selector availablePlugins; r = python.pkgs.toPythonApplication (python.pkgs.nixops.overridePythonAttrs (old: { propagatedBuildInputs = old.propagatedBuildInputs ++ selected; @@ -39,7 +41,7 @@ let ''; passthru = old.passthru // { - plugins = plugins python.pkgs; + plugins = availablePlugins; inherit withPlugins python; tests = old.passthru.tests // { nixos = old.passthru.tests.nixos.passthru.override {