forked from the-nix-way/nix-flake-dev-environments
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
32 lines (27 loc) · 858 Bytes
/
flake.nix
File metadata and controls
32 lines (27 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
description = "A Nix-flake-based Java development environment";
# GitHub URLs for the Nix inputs we're using
inputs = {
# Simply the greatest package repository on the planet
nixpkgs.url = "github:NixOS/nixpkgs";
# A set of helper functions for using flakes
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
java = pkgs.jdk17_headless;
others = with pkgs; [ gradle maven ];
in {
devShells = {
default = pkgs.mkShell {
# Packages included in the environment
buildInputs = [ java ] ++ others;
shellHook = ''
${java}/bin/java -version
'';
};
};
});
}