-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
88 lines (77 loc) · 2.17 KB
/
Copy pathflake.nix
File metadata and controls
88 lines (77 loc) · 2.17 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
description = "OpenJML Playground";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
utils,
...
}:
utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
permittedInsecurePackages = [ "gradle-7.6.6" ];
};
};
openjmlPkg = let
version = "21.0.26";
platforms = {
"x86_64-linux" = {
asset = "openjml-ubuntu-24.04-21.0.26.zip";
sha256 = "sha256-KfIkLZ84bzvoq0jNDkWZKxrwafiqbCKXv9AsExSj9eQ=";
};
"aarch64-linux" = {
asset = "openjml-ubuntu-arm64-21.0.26.zip";
sha256 = "";
};
"x86_64-darwin" = {
asset = "openjml-macos-x86_64-21.0.26.zip";
sha256 = "";
};
"aarch64-darwin" = {
asset = "openjml-macos-arm64-21.0.26.zip";
sha256 = "";
};
};
cfg = platforms.${system};
in pkgs.stdenv.mkDerivation {
pname = "openjml";
inherit version;
src = pkgs.fetchzip {
url = "https://github.com/OpenJML/OpenJML/releases/download/${version}/${cfg.asset}";
inherit (cfg) sha256;
stripRoot = false;
};
installPhase = ''
mkdir -p $out/share/openjml $out/bin
cp -r * $out/share/openjml/
ln -s $out/share/openjml/openjml $out/bin/openjml
'';
};
in
{
packages = {
openjml = openjmlPkg;
};
apps = rec {
openjml = {
type = "app";
program = "${openjmlPkg}/bin/openjml";
};
};
devShells.default = pkgs.mkShell {
buildInputs = [ pkgs.jdk17 pkgs.lefthook openjmlPkg ];
JAVA_HOME = "${pkgs.jdk17}";
JAVAFX_JMODS = "${pkgs.jdk17}/lib/openjdk/jmods";
OPENJML_HOME = "${pkgs.jdk17}/share/openjml";
};
}
);
}