nixops icon indicating copy to clipboard operation
nixops copied to clipboard

Unclear how to install plugins

Open jhillyerd opened this issue 4 years ago • 10 comments

I don't find mention of how to install plugins in the README or the docs linked from there.

Assuming most new nixops users are going to want to try nixops with libvirtd or VirtualBox, this is a significant adoption blocker.

jhillyerd avatar Apr 24 '20 16:04 jhillyerd

I've now a significant amount of time trying to figure out how to install plugins and have failed.

I'm guessing we need to use poetry given https://github.com/NixOS/nixops/pull/1284 - but I'm not much of a Python developer.

Update: Some good info in https://github.com/NixOS/nixops/pull/1256

Update 2: I've had some success by following the steps in https://github.com/nix-community/nixops-libvirtd/pull/10

jhillyerd avatar Apr 25 '20 03:04 jhillyerd

It would be nice if the readme had some documentaiton about how to build NixOps with a plugin, such as the NixOps AWS plugin.

CC @adisbladis @grahamc

bhipple avatar May 07 '20 18:05 bhipple

I also was lost regarding plugins. But since the nixpkgs 20.03 release still uses nixops 1.7(no plugins?), I'm guessing we should stick to that.

steve-chavez avatar May 11 '20 19:05 steve-chavez

I've started writing some docs on this in a guide format, starting with the nixops-aws plugin.

grahamc avatar May 11 '20 21:05 grahamc

I've started writing some docs on this in a guide format, starting with the nixops-aws plugin.

It would be really awesome, if you were willing to share our ongoing efforts!

typetetris avatar Aug 10 '20 07:08 typetetris

Took @adisbladis work and try to stuff in some more plugins: https://github.com/typetetris/nixops-with-plugins

Maybe the boilerplate code from there should go back into poetry2nix.

typetetris avatar Aug 10 '20 11:08 typetetris

My guess is that plugins should provide a flake.nix with an overlay that adds their required python packages.

Thus, one would use a flake.nix such as:

{
  inputs.nixops.url = github:NixOS/nixops;
  inputs.nixops-vbox.url = github:nix-community/nixops-vbox;
  outputs = {nixpkgs, nixops, nixops-vbox}:
    let 
      pkgs = import nixpkgs {
        system = "x86_64-linux";
        overlays = [nixops.overlays.default nixops-vbox.overlays.default];
      };
      nixops-full = pkgs.nixops.withPlugins(p: [p.nixops-vbox]);
    in {
      devShells.x86_64_linux.default = pkgs.mkShell {
        packages = [nixops-full];
      };
    };
}

This is just a proposal and it won't work as of today. Maybe something that reuses python.withPackages instead would be just enough.

The fact is that starting to use NixOps is close to impossible, with the mix of this issue and #1452.

yajo avatar Jul 05 '22 09:07 yajo

I would recommend to use nixopsUnstable from Nixpkgs. It comes with most plugins installed, so you don't have to bother with poetry2nix yourself.

Nonetheless it would be good to document how to package a custom set of plugins.

roberth avatar Jul 05 '22 12:07 roberth

That seems like a handy workaround. Sadly it's broken with both vbox and libvirtd plugins, so I cannot test it. See https://github.com/nix-community/nixops-libvirtd/issues/29 and https://github.com/nix-community/nixops-vbox/pull/28.

yajo avatar Jul 05 '22 13:07 yajo

It seems https://github.com/lukebfox/nixops-plugged provides a sane way to install nixops 2.0, and includes the fix for the vbox plugin in https://github.com/lukebfox/nixops-plugged/commit/24ede623ee5783a76ffc174e4bea655821b55ecb.

yajo avatar Jul 06 '22 12:07 yajo