Sbtix icon indicating copy to clipboard operation
Sbtix copied to clipboard

Get rid of Nix dependency

Open nightkr opened this issue 8 years ago • 6 comments

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-scripts if it's not installed
  • [ ] Teach genNix about the "project" build, replacing sbtix-gen-all
  • [ ] Make sbt genNix the main entry point, rather than sbtix-gen
  • [ ] Drop the sbtix-gen* scripts
  • [ ] Publish to Maven Central! (eventually)

nightkr avatar Jul 15 '17 08:07 nightkr

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?

Ma27 avatar Aug 20 '17 20:08 Ma27

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.

nightkr avatar Aug 20 '17 20:08 nightkr

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?

Ma27 avatar Aug 20 '17 21:08 Ma27

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 genNix on computers with and without Nix, which makes testing easier

nightkr avatar Aug 20 '17 21:08 nightkr

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.

nightkr avatar Aug 20 '17 21:08 nightkr

The project has moved to GitLab: https://gitlab.com/teozkr/Sbtix/merge_requests/27

nightkr avatar Jun 06 '18 12:06 nightkr