The only requirement to compile and run this project is Nix. You can install it with the following command:
curl -L https://nixos.org/nix/install | sh
To have coursier
, java
and sbt
available, run nix-shell
. Then you can use any of these packages as usual.
Note: in order to create the base-jre
, you also need to have Docker installed as it needs to run as daemon so it cannot be provided in the shell.nix
.
> nix-build nix/docker.nix -o result-base-jre
> docker load < result-base-jre
> sbt "docker:publishLocal"
Run the Docker image.
> docker run -it sbt-nix-scala-test-nix:0.1.0-SNAPSHOT
Running nix-build
will pick up default.nix
, which uses sbt-derivation.
> nix-build
Run the binary as follows.
> result/bin/sbt-nix-scala-test-nix
Make sure you read the comprehensive guide at https://github.com/gvolpe/sbt-nix.g8, if you feel stuck.