AshleyYakeley / NixVirt

LibVirt domain management for Nix
MIT License
192 stars 21 forks source link

Flake-Less compatibility #59

Closed itzwam closed 1 month ago

itzwam commented 1 month ago

This PR lets anybody to import this repository without flakes enabled

keeping the flakes-enabled behavior unchanged

npins example:

  imports = [
    (import (import ./npins).NixVirt {
      inherit pkgs;
      inherit (pkgs) OVMFFull; # Change to inherit from an unstable version of pkgs
    }).nixosModules.default
  ];
AshleyYakeley commented 1 month ago

Would prefer to keep NixVirt flakes-only, rather than having to support the legacy way of doing things. You can import the flake in any case by using builtins.getFlake.

Rosuavio commented 1 month ago

"Flake-less" is not generally considered legacy amongst the community, or even the core nix project or anything based on it.

I personally avoid flakes when it's easy enough too, and it's generally fairly easy to use niv or npins to avoid using flakes.

Rosuavio commented 1 month ago

This kind of change to simplify using a project without relying on flakes is fairly common amongst commonly used nix projects.

itzwam commented 1 month ago

This change allows anyone not depending on flakes to import the repo

builtins.getFlake is not available in flake-less world 😉

AshleyYakeley commented 1 month ago

OK, it's probably not fair to call the old unstructured way of doing things legacy while flakes is still marked as an experimental feature. Nevertheless at some point flakes will become stable, the flakes extension flag will go away and builtins.getFlake will always be available. This is the nix world I am interested in developing for, on my own time.

I can understand not wanting to use flakes for one's own stuff and using getFlake to work with other people's flakes, but I'm not interested in the additional maintenance burden to support people who won't even switch on the flakes extension. Flakes are coming anyway.

AshleyYakeley commented 1 month ago

See #61.

AshleyYakeley commented 1 month ago

Closing in favour of #61.