-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
44 lines (36 loc) · 1.08 KB
/
flake.nix
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
33
34
35
36
37
38
39
40
41
42
43
44
{
description = "Nix Flake defining a dev environment for a Kotlin + Ktor + exposed Webapp";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
# Generate a user-friendly version number.
version = builtins.substring 0 8 self.lastModifiedDate;
javaVersion = 20;
overlays = [
(final: prev: rec {
jdk = prev."jdk${toString javaVersion}";
gradle = prev.gradle.override { java = jdk; };
kotlin = prev.kotlin.override { jre = jdk; };
})
];
pkgs = import nixpkgs {
inherit system overlays;
};
buildInputs = with pkgs; [
gradle
kotlin
];
in
with pkgs;
{
# formatter: Specify the formatter that will be used by the command `nix fmt`.
formatter = nixpkgs-fmt;
devShells.default = mkShell {
inherit buildInputs;
};
});
}