Skip to content

Commit

Permalink
use the typelevel Nix flake to build the dev shell for this project
Browse files Browse the repository at this point in the history
  • Loading branch information
vreuter committed Jun 26, 2024
1 parent ec97895 commit 050d55a
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 13 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ This project builds using [sbt][sbt].
* 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 just need to have the [Nix package manager][nix] installed on your machine, and then from this project's root folder run `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]: https://nixos.org/download/
[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;
};
};
}
);
}
11 changes: 0 additions & 11 deletions shell.nix

This file was deleted.

0 comments on commit 050d55a

Please sign in to comment.