nix-community / nixops-libvirtd

NixOps libvirtd backend plugin [maintainer=@AmineChikhaoui]
GNU Lesser General Public License v3.0
35 stars 20 forks source link

How to develop on nixops-libvird ? #1

Open teto opened 4 years ago

teto commented 4 years ago

I would like to port some of the pull requests from the old repo to the new one. How can I use this plugin in let's say development mode ? with my local nixops clone.

cheers

AmineChikhaoui commented 4 years ago

Copying the discussion from #nixops irc channel:

09:00 aminechikhaoui: testing should be a matter of ./dev-shell --arg p "(p: [ (p.callPackage ../path/to/nixops-libvirtd/release.nix {})])" 09:01 aminechikhaoui: without modifying data.nix 09:02 teto: cool thanks. Will try to port some of my changes to the new plugin

teto commented 4 years ago

running that command:

./dev-shell --arg p "(p: [ (p.callPackage ~/nixops-libvirtd/release.nix {})])"                             
trace: Using plugins: ["/nix/store/5fz5viaigvdkrad0qcwv5dx9ki74v48b-nixops-libvirtd"]

doesn't run libvirtd in develop mode, so I have to rerun the command after each change :/

teto commented 4 years ago

I've updated to nixops master (not used for the past 6 months ) and ./dev-shell --arg p "(p: [ (p.callPackage /home/teto/nixops-libvirtd/release.nix {})])" seems ineffective ? what's the new way ? can https://github.com/nix-community/nixops-libvirtd/pull/10 help ?

adamlwgriffiths commented 3 years ago

I'm wanting to do this too but there isn't a dev-shell file in the repo. Closest I can see is this equivalent in another repo.

The "hacking" link for this repo unfortunately resolves to an older version of the NixOps docs. The link is correct it's just that it resolves to an older build. The latest versions differs in it's commands.

Running the new commands only results in a version of nixops, it doesn't pull libvirtd in with it, which makes sense. So there's obviously some steps that aren't listed in that link that are required.

pjones commented 3 years ago

With the new plugin system it's not clear how one can install NixOps + libvirt. I don't see anything in the NixOps documentation on how to install plugins either.

The released versions of these tools are broken so I'm using a pinned version from Git. However the pinned version I'm using is using libvirt 5.9 which is now flagged in NixOS 20.09 as being disabled for security problems.

The code I have for hacking in an override doesn't work anymore:

  nixops = (super.callPackage "${sources.nixops}/release.nix" {
    p = _: [
      (super.callPackage "${sources.nixops-libvirtd}/release.nix" { })
    ];
  }).build.${super.system};

The NixOps release.nix file has been removed from the repo. The release.nix file in this repo is broken because it references setup.py which no longer exists.

How are people getting a working NixOps with libvirt support?

teto commented 3 years ago

I haven't used nixops the past year but would like to do it again and yes it lacks instructions, Can we add a flake.nix to the repo ? is it just a master of creating a python environment with both nixops and this plugin ?