Skip to content

Commit

Permalink
Merge pull request #615 from vreuter/feature/add-nix-shell
Browse files Browse the repository at this point in the history
Add small Nix shell for development
  • Loading branch information
satabin authored Jul 1, 2024
2 parents b42cfa0 + 050d55a commit cafc4c7
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ This project builds using [sbt][sbt].
* build the documentation: `sbt ;documentation/mdoc; makeSite`
* run benchmarks (you can provide [JMH][jmh] arguments in the end): `sbt benchmarksJVM/jmh:run`

If you don't already have `sbt`, or if you'd like an isolated environment for development on this project, you may use the Nix shell.
For that, you must have the [Nix package manager][nix-download] installed on your machine, and you need to enable [Nix flakes][nix-flakes] and [Nix command][nix-command].
With those prerequisites, from this project's root folder you just need to run `nix develop`.
If you just want to enable the experimental Nix features (command and flakes) locally and temporarily, add the `--extra-experimental-features nix-command` and the `--extra-experimental-features flakes` option/argument pairs to the `nix develop` command.

[fs2]: https://fs2.io/
[sbt]: https://scala-sbt.org
[jmh]: https://openjdk.java.net/projects/code-tools/jmh/
[website]: https://fs2-data.gnieh.org
[nix-download]: https://nixos.org/download/
[nix-command]: https://nixos.wiki/wiki/Nix_command
[nix-flakes]: https://nixos.wiki/wiki/Flakes
143 changes: 143 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
inputs = {
typelevel-nix.url = "github:typelevel/typelevel-nix";
nixpkgs.follows = "typelevel-nix/nixpkgs";
flake-utils.follows = "typelevel-nix/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, typelevel-nix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ typelevel-nix.overlays.default ];
};
in
{
devShell = pkgs.devshell.mkShell {
imports = [ typelevel-nix.typelevelShell ];
name = "fs2-data-shell";
typelevelShell = {
jdk.package = pkgs.jdk11;
};
};
}
);
}

0 comments on commit cafc4c7

Please sign in to comment.