2022-07-28 14:54:27 -07:00
|
|
|
{
|
2022-07-28 15:14:21 -07:00
|
|
|
description = "A Nix-flake-based Scala development environment";
|
2022-07-28 14:54:27 -07:00
|
|
|
|
2022-07-31 04:02:06 -07:00
|
|
|
inputs = { dev.url = "github:the-nix-way/dev-templates"; };
|
2022-07-28 14:54:27 -07:00
|
|
|
|
2022-07-31 03:57:49 -07:00
|
|
|
outputs = { self, dev }:
|
2022-07-31 04:02:06 -07:00
|
|
|
let inherit (dev.lib) flake-utils nixpkgs;
|
2022-07-31 03:57:49 -07:00
|
|
|
in flake-utils.lib.eachDefaultSystem (system:
|
2022-07-28 14:54:27 -07:00
|
|
|
let
|
|
|
|
jdk = "jdk17";
|
|
|
|
|
|
|
|
config = {
|
|
|
|
packageOverrides = p: {
|
2022-07-28 15:11:05 -07:00
|
|
|
sbt = p.sbt.override { jre = p.${jdk}; };
|
|
|
|
scala_3 = p.scala_3.override { jre = p.${jdk}; };
|
2022-07-28 14:54:27 -07:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
pkgs = import nixpkgs { inherit config jdk system; };
|
|
|
|
|
|
|
|
inherit (pkgs) mkShell;
|
|
|
|
|
|
|
|
scala = pkgs.scala_3;
|
|
|
|
|
|
|
|
buildTools = with pkgs; [ sbt ];
|
|
|
|
in {
|
|
|
|
devShells = {
|
2022-07-28 16:21:18 -07:00
|
|
|
default = mkShell {
|
2022-07-31 08:59:22 -07:00
|
|
|
buildInputs = [ scala ] ++ buildTools;
|
2022-07-28 14:54:27 -07:00
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
${scala}/bin/scala -version
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2022-07-28 15:11:05 -07:00
|
|
|
});
|
2022-07-28 14:54:27 -07:00
|
|
|
}
|