1
1
Fork 0
mirror of https://github.com/the-nix-way/dev-templates synced 2024-05-06 08:46:07 +02:00
github.com_the-nix-way_dev-.../kotlin/flake.nix
2023-03-06 13:28:29 +02:00

43 lines
906 B
Nix

{
description = "A Nix-flake-based Kotlin development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ self
, nixpkgs
, flake-utils
}:
flake-utils.lib.eachDefaultSystem (system:
let
javaVersion = 17;
overlays = [
(self: super: rec {
jdk = pkgs."jdk${toString javaVersion}";
gradle = super.gradle.override {
java = jdk;
};
kotlin = super.kotlin.override {
jre = jdk;
};
})
];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [ kotlin gradle gcc ncurses patchelf zlib ];
shellHook = ''
${pkgs.kotlin}/bin/kotlin -version
'';
};
});
}