Add Nix flake

This commit is contained in:
2026-05-03 17:07:47 +02:00
parent 786c11981b
commit 406c104158
4 changed files with 120 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
use flake
+2
View File
@@ -39,3 +39,5 @@ nb-configuration.xml
/.quarkus/cli/plugins/
# TLS Certificates
.certs/
.direnv
Generated
+61
View File
@@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1769789167,
"narHash": "sha256-kKB3bqYJU5nzYeIROI82Ef9VtTbu4uA3YydSk/Bioa8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "62c8382960464ceb98ea593cb8321a2cf8f9e3e5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
+56
View File
@@ -0,0 +1,56 @@
{
description = "DevShell for Kotlin + Quarkus";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
browsers = pkgs.playwright-driver.browsers;
chromiumDir = builtins.head (
builtins.filter (n: builtins.match "chromium-[0-9]+" n != null)
(builtins.attrNames (builtins.readDir "${browsers}"))
);
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
jdk21
quarkus
kotlin
kotlin-language-server
nodejs
playwright-driver.browsers
];
JAVA_HOME = "${pkgs.jdk21}";
PLAYWRIGHT_BROWSERS_PATH = "${browsers}";
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1";
PLAYWRIGHT_NODEJS_PATH = "${pkgs.nodejs}/bin/node";
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH = "${browsers}/${chromiumDir}/chrome-linux64/chrome";
shellHook = ''
echo "🚀 Kotlin Quarkus development environment loaded"
echo "Java version:"
java -version
echo ""
echo "Quarkus CLI version:"
quarkus version
export QUARKUS_LAUNCH_DEV_MODE=true
alias qdev="quarkus dev"
alias qbuild="quarkus build"
'';
};
}
);
}