-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathflake.nix
62 lines (60 loc) · 1.9 KB
/
flake.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
{
description = "A single-shot nREPL client designed for shell invocation.";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
let
packageOutputs = flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
rep = pkgs.callPackage ./derivation.nix {};
in {
packages = {
default = rep;
inherit rep;
};
});
checkSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
checkOutputs = flake-utils.lib.eachSystem checkSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
rep = pkgs.callPackage ./derivation.nix {};
in {
checks = {
unit-test = let
java-deps = import ./test-deps.nix { inherit (pkgs) fetchMavenArtifact fetchgit lib; };
in pkgs.stdenv.mkDerivation {
name = "rep-unit-tests";
src = ./.;
buildInputs = with pkgs; [ rep jdk17_headless ];
CLASSPATH = java-deps.makeClasspaths { extraClasspaths = [ "test" "src" ]; };
REP_TEST_DRIVER = "native";
REP_TO_TEST = "${rep}/bin/rep";
buildPhase = ''
rm -rf target/
mkdir -p target/
java clojure.main -e "
(require 'midje.repl)
(System/exit (min 255 (:failures (midje.repl/load-facts :all))))
"
'';
installPhase = ''
touch $out
'';
};
};
});
overlayOutputs = {
overlays.default = final: prev: {
rep = prev.callPackage ./derivation.nix {};
};
};
in
packageOutputs // checkOutputs // overlayOutputs;
}