blob: 4cd29c628c68ef25f6cce9f1ca6c359f7ef2146c (
plain)
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
|
inputs @ {
pkgs,
crane,
...
}: let
inherit (pkgs) system;
toolchain = pkgs.rust-bin.fromRustupToolchain ((builtins.fromTOML (builtins.readFile ../src/rust-toolchain.toml)).toolchain // {profile = "minimal";});
craneLib = crane.lib.${system}.overrideToolchain toolchain;
rustCrate = craneLib.buildPackage {
pname = "candelabra-unwrapped";
version = "1.0.0";
src = craneLib.cleanCargoSource (craneLib.path ../src);
doCheck = false;
propagatedBuildInputs = [];
cargoExtraArgs = "-p candelabra-cli";
};
in
pkgs.runCommand "candelabra" {} ''
. ${pkgs.makeWrapper}/nix-support/setup-hook
mkdir -p $out/{bin,nix-support}
makeWrapper ${rustCrate}/bin/candelabra $out/bin/candelabra \
--set CANDELABRA_SRC_DIR ${pkgs.lib.sourceByRegex ../src [
".*crates"
".*racket_specs.*"
".*crates/library.*"
".*crates/benchmarker.*"
".*rust-toolchain.toml.*"
".*Cargo.toml.*"
".*Cargo.lock.*"
]} \
--prefix PATH : ${pkgs.callPackage ./racket-env.nix inputs}/bin \
--prefix PATH : ${toolchain}/bin \
--prefix PATH : ${pkgs.gcc}/bin;
''
|