74 lines
1.9 KiB
Nix
74 lines
1.9 KiB
Nix
{ pkgs, self }:
|
|
let
|
|
clusterflux-tools = pkgs.rustPlatform.buildRustPackage {
|
|
pname = "clusterflux-tools";
|
|
version = "0.1.0";
|
|
src = self;
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
nativeBuildInputs = [
|
|
pkgs.git
|
|
pkgs.lld
|
|
pkgs.makeWrapper
|
|
];
|
|
cargoBuildFlags = [
|
|
"--package"
|
|
"clusterflux-cli"
|
|
"--package"
|
|
"clusterflux-node"
|
|
"--package"
|
|
"clusterflux-coordinator"
|
|
"--package"
|
|
"clusterflux-dap"
|
|
];
|
|
cargoTestFlags = [
|
|
"--package"
|
|
"clusterflux-cli"
|
|
"--package"
|
|
"clusterflux-node"
|
|
"--package"
|
|
"clusterflux-coordinator"
|
|
"--package"
|
|
"clusterflux-dap"
|
|
];
|
|
NIX_BUILD_CORES = "2";
|
|
RUST_MIN_STACK = "1073741824";
|
|
postInstall = ''
|
|
test -x "$out/bin/clusterflux"
|
|
test -x "$out/bin/clusterflux-node"
|
|
test -x "$out/bin/clusterflux-coordinator"
|
|
test -x "$out/bin/clusterflux-debug-dap"
|
|
for command in \
|
|
clusterflux \
|
|
clusterflux-node \
|
|
clusterflux-coordinator \
|
|
clusterflux-debug-dap
|
|
do
|
|
${pkgs.coreutils}/bin/timeout 5 "$out/bin/$command" --version >/dev/null
|
|
${pkgs.coreutils}/bin/timeout 5 "$out/bin/$command" --help >/dev/null
|
|
done
|
|
'';
|
|
postFixup =
|
|
let
|
|
runtimePath = pkgs.lib.makeBinPath [
|
|
pkgs.cargo
|
|
pkgs.git
|
|
pkgs.lld
|
|
pkgs.rustc
|
|
];
|
|
in
|
|
''
|
|
wrapProgram "$out/bin/clusterflux" --prefix PATH : ${runtimePath}
|
|
wrapProgram "$out/bin/clusterflux-node" --prefix PATH : ${runtimePath}
|
|
wrapProgram "$out/bin/clusterflux-debug-dap" --prefix PATH : ${runtimePath}
|
|
'';
|
|
meta = {
|
|
description = "Clusterflux CLI, node, coordinator, and debugger adapter";
|
|
mainProgram = "clusterflux";
|
|
};
|
|
};
|
|
in
|
|
{
|
|
inherit clusterflux-tools;
|
|
clusterflux = clusterflux-tools;
|
|
default = clusterflux-tools;
|
|
}
|