Skip to content

Commit 5105d32

Browse files
authored
Merge pull request #2 from magaransoft/1-add-nix-flake-devshell
Add Nix flake devshell with direnv
2 parents 31e797b + fe08bfe commit 5105d32

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,5 @@ metals.sbt
5151
# Claude Code
5252
.claude/
5353
MEMORY.md
54+
.envrc
55+
.direnv/

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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
description = "Dev environment";
3+
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5+
6+
outputs = { self, nixpkgs }:
7+
let
8+
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
9+
forEachSystem = f: builtins.listToAttrs (map (system: {
10+
name = system;
11+
value = f system;
12+
}) supportedSystems);
13+
in {
14+
devShells = forEachSystem (system:
15+
let pkgs = nixpkgs.legacyPackages.${system};
16+
in {
17+
default = pkgs.mkShell {
18+
buildInputs = with pkgs; [ jdk21 sbt ];
19+
shellHook = ''
20+
export JAVA_HOME="${pkgs.jdk21}"
21+
'';
22+
};
23+
}
24+
);
25+
};
26+
}

0 commit comments

Comments
 (0)