From 5a1285c2163173217d2adc5f56a4b7bd5234b714 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 28 Feb 2024 23:38:47 +0100 Subject: nixops_unstable_*: Add addAvailablePlugins --- pkgs/applications/networking/cluster/nixops/default.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'pkgs/applications/networking/cluster/nixops/default.nix') 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; -- cgit 1.4.1