Skip to content

Commit 2135a57

Browse files
committed
add nix-shell template (shell.nix)
1 parent c83b5ea commit 2135a57

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ nb-configuration.xml
5757
## OS X
5858
.DS_Store
5959

60+
## nix-shell
61+
/shell.nix
62+
6063
# Development
6164
todo/
6265
/ci/qemu/

doc/shell.nix

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Development environment with nix-shell
2+
{ pkgs ? import <nixpkgs> {}
3+
}:
4+
pkgs.mkShell {
5+
name="java-gtk";
6+
buildInputs = [
7+
pkgs.git
8+
pkgs.jdk21_headless # Non headless is linked against gtk3 and does therefore not work
9+
pkgs.gtk4
10+
];
11+
shellHook = ''
12+
LD_LIBRARY_PATH=${pkgs.gtk4.outPath}/lib
13+
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${pkgs.glib.out.outPath}/lib
14+
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${pkgs.gdk-pixbuf.outPath}/lib
15+
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${pkgs.cairo.outPath}/lib
16+
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${pkgs.pango.out.outPath}/lib
17+
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${pkgs.libadwaita.outPath}/lib
18+
export LD_LIBRARY_PATH
19+
echo "https://github.com/bailuk/java-gtk"
20+
echo "./gradlew generate && ./gradlew build && ./gradlew run"
21+
'';
22+
}

0 commit comments

Comments
 (0)