-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
59 lines (59 loc) · 2.2 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/24.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
julia = pkgs.julia_110-bin;
in rec {
packages = {
pe2 = pkgs.stdenv.mkDerivation {
name = "pe";
pname = "pe";
src =./src;
buildInputs = [julia];
buildPhase = ''
mkdir -p $out/src/pe
cp -r $src/pe $out/src
mkdir -p $out/.julia
JULIA_DEPOT_PATH=$out/.julia julia --project=$out/src/pe -e "\
using Pkg; \
Pkg.instantiate();"
'';
installPhase = ''
echo "julia -e \"using InteractiveUtils\
versioninfo()\"" > $bin
'';
};
pe = pkgs.writeShellScriptBin "pe" ''
julia --startup-file=no \
--color=yes \
--project=src/pe \
./src/pe/main.jl $1 $2
'';
};
checks.my-check = pkgs.runCommand "my-check" {
src=./.;
buildPhase = ''
echo "Building"
mkdir -p $out
cp -r $src $out
ls -la $out
echo "Built"
'';
phases = "buildPhase";
buildInputs = [pkgs.julia packages.pe];
} ''
ln -s $src/src src
test $(pe run 1)
touch $out
'';
devShells.default = pkgs.mkShell {
buildInputs = [julia packages.pe];
};
}
);
}