-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
62 lines (58 loc) · 1.75 KB
/
Copy pathflake.nix
File metadata and controls
62 lines (58 loc) · 1.75 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
description = "jni build environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs =
{ flake-parts, nixpkgs, ... } @ inputs: flake-parts.lib.mkFlake { inherit inputs; } (
{
perSystem = { config, self', inputs', pkgs, system, ... }: rec {
packages = {
jdk25-wrapped = pkgs.symlinkJoin rec {
name = "jdk25-wrapped";
paths = [ pkgs.jdk25 ];
nativeBuildInputs = with pkgs; [
makeWrapper
];
buildInputs = with pkgs; [
libglvnd
mesa
libva.out
libpulseaudio
alsa-lib
dbus.lib
# pipewire
];
postBuild = let
libPath = builtins.concatStringsSep ":" (map (it: "${it}/lib") buildInputs);
in ''
for bin in $out/bin/*; do
wrapProgram "$bin" --set LD_LIBRARY_PATH "${libPath}"
done
'';
};
};
devShells = rec {
mpv-java = pkgs.stdenvNoCC.mkDerivation {
name = "mpv-java";
version = "0.1.0";
nativeBuildInputs = with pkgs; [
packages.jdk25-wrapped
gradle_9
];
buildInputs = with pkgs; [
libglvnd
];
shellHook = ''
export JAVA_HOME="${packages.jdk25-wrapped}"
'';
};
default = mpv-java;
};
};
flake = { };
systems = [ "x86_64-linux" "aarch64-linux" ];
}
);
}