about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/nixops/default.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2024-02-28 23:38:47 +0100
committerRobert Hensing <robert@roberthensing.nl>2024-03-06 22:47:24 +0100
commit5a1285c2163173217d2adc5f56a4b7bd5234b714 (patch)
tree2dcaf271ca1294867594d04ebc6cce25f0d71038 /pkgs/applications/networking/cluster/nixops/default.nix
parent8b9543baac8c68e46382edc92ff3c65294af1310 (diff)
nixops_unstable_*: Add addAvailablePlugins
Diffstat (limited to 'pkgs/applications/networking/cluster/nixops/default.nix')
-rw-r--r--pkgs/applications/networking/cluster/nixops/default.nix16
1 files changed, 13 insertions, 3 deletions
diff --git a/pkgs/applications/networking/cluster/nixops/default.nix b/pkgs/applications/networking/cluster/nixops/default.nix
index 058400c2d94d0..d3efd3ed24480 100644
--- a/pkgs/applications/networking/cluster/nixops/default.nix
+++ b/pkgs/applications/networking/cluster/nixops/default.nix
@@ -14,10 +14,10 @@ let
     python = python3.override {
       packageOverrides = self: super: {
         nixops = self.callPackage ./unwrapped.nix { };
-      } // (this.plugins self);
+      } // (this.plugins self super);
     };
 
-    plugins = ps: with ps; rec {
+    plugins = ps: _super: with ps; rec {
       nixops-aws = callPackage ./plugins/nixops-aws.nix { };
       nixops-digitalocean = callPackage ./plugins/nixops-digitalocean.nix { };
       nixops-encrypted-links = callPackage ./plugins/nixops-encrypted-links.nix { };
@@ -35,7 +35,8 @@ let
       nixopsvbox = nixops-vbox;
     };
 
-    availablePlugins = this.plugins this.python.pkgs;
+    # We should not reapply the overlay, but it tends to work out. (It's been this way since poetry2nix was dropped.)
+    availablePlugins = this.plugins this.python.pkgs this.python.pkgs;
 
     selectedPlugins = [];
 
@@ -73,6 +74,15 @@ let
       overrideAttrs = f: this.extend (this: oldThis: {
         rawPackage = oldThis.rawPackage.overrideAttrs f;
       });
+      /**
+       * nixops.addAvailablePlugins: Overlay -> Package
+       *
+       * Add available plugins to the package. You probably also want to enable
+       * them with the `withPlugins` method.
+       */
+      addAvailablePlugins = newPlugins: this.extend (finalThis: oldThis: {
+        plugins = lib.composeExtensions oldThis.plugins newPlugins;
+      });
     };
 
     package = lib.lazyDerivation { outputs = [ "out" "dist" ]; derivation = this.rawPackage; } // this.extraPackageAttrs;