nixops
nixops copied to clipboard
Unclear how to install plugins
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.
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
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
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.
I've started writing some docs on this in a guide format, starting with the nixops-aws plugin.
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!
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.
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.
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.
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.
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.