[Nix-dev] Sbtix - SBT project builder

Teo Klestrup Röijezon teo at nullable.se
Sat Aug 27 19:02:58 CEST 2016


Granularity, performance and compatibility with existing SBT plugins would
probably be the main differences.

I don't have a lot of experience with Sbt2nix, but from what I can tell,
Sbt2nix generates a Nix derivation with the dependencies of each project,
but then builds it by hand by calling javac/scalac itself. This means that,
for example, any custom build steps (such as Proguard, Scala.js, or
sbt-web) are skipped unless you re-implement them by hand. It also seems
like Sbt2nix hardcodes the Maven repositories that are used (see
https://github.com/charleso/sbt2nix/blob/83a95e5cac9267bf462f52fed94a113a5a513075/plugin/src/main/resources/sbt.nix).
All in all, you can probably get Sbt2nix to do the right thing, but unless
your project is either new or has a very vanilla build setup then it looks
like you would basically end up reimplementing your SBT plugins in bash.
However, if you do get it to work, then you should get faster builds,
better caching, and a smaller risk of impurities sneaking in.

Sbtix, on the other hand, has one build for the whole SBT "build", and
(currently) only tries to implement a Nix-managed "offline mode" for SBT,
where Nix takes care of dependencies but lets SBT handle how to actually
build the project. So any SBT plugins you use should still "just work".

Another side effect of how Sbtix works is that you could just take the
environment it builds, serve it on a web server, and use it as your primary
resolver to avoid everyone in your organization needing to hit up Maven
Central to whenever they/their IDE decide to redownload the world, without
requiring that everyone uses Nix for local development builds.



On 27 August 2016 at 17:29, Matan Shenhav <matan at fluxcraft.net> wrote:

> Yes! Awesome stuff. Our team is currently setting up a development
> environment, and this will come in handy!
>
> How does this project stand in relation to Sbt2nix
> <https://github.com/charleso/sbt2nix>?
>
>
>  * * * * *
>
> Matan Bendix Shenhav
>
> *Chief Science Officer*Fluxcraft
> +358 (0)45 6 135 315
>
>
> ---- On Fri, 26 Aug 2016 13:13:24 -0700 *Teo Klestrup
> Röijezon<teo at nullable.se <teo at nullable.se>>* wrote ----
>
> Hi,
>
> Lately I've been working on a project to help build SBT projects with Nix:
> https://github.com/teozkr/Sbtix.
>
> Currently it provides some basic project boilerplate and downloads your
> project dependencies for you (like Bundix), but it would be nice to have it
> also download, say, your SBT plugins and the pinned SBT version. Those are
> currently not handled, since the current (hacky) way of discovering all SBT
> projects in the build does not find build projects.
>
> It's also pretty invasive at the moment, since it requires you to replace
> SBT's native Ivy dependency resolver with Coursier. In most cases it should
> be a drop-in replacement, but naturally I'm sure there are edge cases I
> haven't thought of.
>
> Do you guys think this is something worth pursuing further?
>
> // Teo
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160827/a501d765/attachment.html>


More information about the nix-dev mailing list