forked from shopstic/chopsticks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchopsticks.nix
68 lines (57 loc) · 1.54 KB
/
chopsticks.nix
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
{ lib
, stdenv
, jdk
, sbt
, chopsticksDeps
}:
stdenv.mkDerivation {
pname = "chopsticks";
version = import ./version.nix;
src = builtins.path
{
path = ../.;
name = "src";
filter = (path: /* type */_:
lib.hasInfix "/chopsticks-" path ||
lib.hasInfix "/project" path ||
lib.hasSuffix ".sbt" path ||
lib.hasSuffix ".scalafmt.conf" path
);
};
buildInputs = [
jdk
sbt
];
configurePhase = ''
cp -R "${chopsticksDeps}/cache" "$TMPDIR/"
export XDG_CACHE_HOME="$TMPDIR/cache"
chmod -R +w "$XDG_CACHE_HOME"
export PROTOC_CACHE="$XDG_CACHE_HOME/protoc_cache";
export COURSIER_CACHE="$XDG_CACHE_HOME/coursier";
export SBT_OPTS="-Dsbt.global.base=$XDG_CACHE_HOME/sbt -Dsbt.ivy.home=$XDG_CACHE_HOME/ivy -Xmx4g -Xss6m"
echo "SBT_OPTS=$SBT_OPTS"
sbt --client cq < <(echo q)
'';
buildPhase = ''
sbt --client compile
sbt --client Test / compile
'';
installPhase = ''
sbt --client 'set ThisBuild / Test / publishArtifact := true'
# sbt --client 'set ThisBuild / publishMavenStyle := false'
sbt --client "set ThisBuild / publishTo := Some(Resolver.file(\"local-maven\", file(\"$out\")))"
sbt --client publish
sbt --client shutdown
'';
doCheck = true;
dontStrip = true;
dontPatch = true;
dontFixup = true;
meta = with lib;
{
description = "Chopsticks";
homepage = "https://chopsticks.dev";
license = licenses.asl20;
platforms = [ "x86_64-darwin" "aarch64-darwin" "x86_64-linux" ];
};
}