Skip to content

Commit 914aa92

Browse files
committed
add flake.nix
1 parent f6e78f5 commit 914aa92

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
description = "lila-ws development environment for Nix & flakes";
3+
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5+
6+
outputs = { self, ... }@inputs:
7+
8+
let
9+
javaVersion = 25;
10+
supportedSystems =
11+
[ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
12+
forEachSupportedSystem = f:
13+
inputs.nixpkgs.lib.genAttrs supportedSystems (system:
14+
f {
15+
pkgs = import inputs.nixpkgs {
16+
inherit system;
17+
overlays = [ inputs.self.overlays.default ];
18+
};
19+
});
20+
in {
21+
overlays.default = final: prev:
22+
let jdk = prev."jdk${toString javaVersion}";
23+
in rec {
24+
25+
sbt = prev.sbt.override { jre = jdk; };
26+
scala = prev.scala_3.override { jre = jdk; };
27+
};
28+
29+
devShells = forEachSupportedSystem ({ pkgs }: {
30+
default =
31+
pkgs.mkShellNoCC { packages = with pkgs; [ scala sbt coursier ]; };
32+
});
33+
};
34+
}

0 commit comments

Comments
 (0)