blob: da0a51cd87dc981d641a519b7b456adff289c768 (
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
|
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 = [(pkgs.callPackage ./racket-env.nix inputs)];
cargoExtraArgs = "-p candelabra-cli";
};
in
pkgs.runCommand "candelabra" {} ''
. ${pkgs.makeWrapper}/nix-support/setup-hook
mkdir -p $out/bin
makeWrapper ${rustCrate}/bin/candelabra $out/bin/candelabra \
--set CANDELABRA_SRC_DIR ${pkgs.lib.sourceByRegex ../src [
".*crates"
".*racket_specs.*"
".*crates/library.*"
".*crates/benchmarker.*"
]}
''
|