Get rid of Nix dependency
As @Ma27 said in https://github.com/teozkr/Sbtix/pull/26#issuecomment-315321196, not everyone can (Windows users) or wants to use Nix (yet, hopefully). Thus, being able to generate Nix builds without having it installed would help make it easier for upstreams to provide up-to-date build files.
- [ ] Hash it ourselves instead of using
nix-prefetch-scriptsif it's not installed - [ ] Teach
genNixabout the "project" build, replacingsbtix-gen-all - [ ] Make
sbt genNixthe main entry point, rather thansbtix-gen - [ ] Drop the
sbtix-gen*scripts - [ ] Publish to Maven Central! (eventually)
just though a little bit about a possible implementation: we might want to generate a package set which contains the name of the derivation and the src (which consists of URL and hash).
Instead of nix-prefetch-* scripts we could fetch the data using Scala and compute the hashes on our side (I just checked it - node2nix does the same for instance).
Then we need to refactor our sbtix.nix expressions to do things like the download when running nix-build or nix-shell.
Would you be fine with such an approach?
All of that already works, nix-build should work without having ran sbtix-gen-* on the same machine. The only difference should be that we download it and calculate the hash in Scala, if nix-prefetch-* is not available.
if nix-prefetch-* is not available.
- yeah that's why I want to compute the hash (optionally) on our side
- but nix-prefetch-* stores the download artifacts in the Nix storewhich is immutable so we can't (and shouldn't) modify it, no?
but nix-prefetch-* stores the download artifacts in the Nix storewhich is immutable so we can't (and shouldn't) modify it, no?
We can add stuff to it by running nix-store --add $PATH. It might be better to use that instead of nix-prefetch-*, since
- nix-prefetch-* is not included with core Nix
- It means a smaller behaviour difference between running
genNixon computers with and without Nix, which makes testing easier
Also, in preparation for this, we should probably rename genComposition to something less likely to cause conflicts. genNixDerivation perhaps? Or just merge it into genNix.
The project has moved to GitLab: https://gitlab.com/teozkr/Sbtix/merge_requests/27