Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce NixOPS plugin structure #72266

Closed
wants to merge 1 commit into from

Conversation

AmineChikhaoui
Copy link
Member

@AmineChikhaoui AmineChikhaoui commented Oct 29, 2019

pkgs.nixopsCore now contains only the None/AWS/Hetzner backends,
other backends are available through pkgs.nixopsPlugins such as
pkgs.nixopsPlugins.nixops-vbox for VirtualBox.

There is also a convenience pkgs.nixopsWithPlugins which makes it
possible to quickly package a NixOPS with additional backends e.g:

let
  nixopsGCE = nixopsPlugins.buildNixOpsPlugin rec {
    pluginName = "gce";
    src = builtins.fetchGit "https://github.com/AmineChikhaoui/nixops-gce";
    version = "pre853_aca0173";
    propagatedBuildInputs = [ python2Packages.libcloud ];
  };
in nixopsWithPlugins {
  plugins = with nixopsPlugins;
    [ nixops-aws nixops-hetzner nixops-libvirtd nixops-datadog nixops-vbox ]
    ++ [ nixopsGCE ];
}
Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @disassembler @edolstra @rbvermaa

pkgs.nixopsCore now contains only the None/AWS/Hetzner backends,
other backends are available through pkgs.nixopsPlugins such as
pkgs.nixopsPlugins.nixops-vbox for VirtualBox.

There is also a convenience pkgs.nixopsWithPlugins which makes it
possible to quickly package a NixOPS with additional backends e.g:

```Nix
let
  nixopsGCE = nixopsPlugins.buildNixOpsPlugin rec {
    pluginName = "gce";
    src = builtins.fetchGit "https://github.com/AmineChikhaoui/nixops-gce";
    version = "pre853_aca0173";
    propagatedBuildInputs = [ python2Packages.libcloud ];
  };
in nixopsWithPlugins {
  plugins = with nixopsPlugins;
    [ nixops-aws nixops-hetzner nixops-libvirtd nixops-datadog nixops-vbox ]
    ++ [ nixopsGCE ];
}
```
@AmineChikhaoui AmineChikhaoui changed the title introduce NixOPS plugin structure Introduce NixOPS plugin structure Oct 29, 2019
@AmineChikhaoui AmineChikhaoui marked this pull request as ready for review November 11, 2019 15:10
@grahamc
Copy link
Member

grahamc commented Jan 27, 2020

It would be better to follow the same API model as python.withPackages / terraform.withPlugins etc:

nixops.withPlugins (nixopsPlugins: with nixopsPlugins; [ plugin1 plugin2 ]);

Terraform has an additionally very useful terraformFull which has all the nixpkgs-defined Terraform plugins included.

@FRidh FRidh added this to the 20.03 milestone Jan 28, 2020
@domenkozar
Copy link
Member

Superseded by #83548

@domenkozar domenkozar closed this Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants