-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
89 lines (76 loc) · 2.22 KB
/
flake.nix
File metadata and controls
89 lines (76 loc) · 2.22 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
89
{
description = "SASyLF";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"aarch64-darwin"
];
perSystem =
{ self', pkgs, ... }:
let
jdk = pkgs.jdk25;
in
{
devShells.default = pkgs.mkShell {
name = "SASyLF";
buildInputs = [
jdk
self'.packages.sasylf
pkgs.jdt-language-server
pkgs.maven
pkgs.nodejs_24
pkgs.pnpm
];
shellHook = ''
export JAVA_HOME=${jdk}
PATH="${jdk}/bin:$PATH"
'';
};
packages.sasylf-jar = pkgs.stdenv.mkDerivation {
pname = "SASyLF";
version = "1.5.1";
src = ./.;
buildInputs = with pkgs; [
jdk
javacc
maven
];
buildPhase = ''
# Create a temporary maven repository
mkdir -p $TMPDIR/.m2/repository
# Run maven with custom repository location
mvn clean generate-sources package \
-pl sasylf \
-Dmaven.repo.local=$TMPDIR/.m2/repository
'';
installPhase = ''
mkdir -p $out/bin
cp sasylf/target/sasylf-*.jar $out/bin/SASyLF.jar
'';
};
packages.sasylf =
let
sasylfScript = pkgs.writeShellScriptBin "sasylf" ''
# Run the SASyLF.jar file
java -jar ${self'.packages.sasylf-jar}/bin/SASyLF.jar $@
'';
in
pkgs.symlinkJoin {
name = "sasylf";
buildInputs = [
self'.packages.sasylf-jar
pkgs.makeWrapper
pkgs.zulu25
];
paths = [ sasylfScript ];
postBuild = "wrapProgram $out/bin/sasylf --prefix PATH : $out/bin";
};
packages.default = self'.packages.sasylf;
};
};
}