Files
gotta-scroll-fast/nix/package.nix
T
thomas 3e8d068494
Tests / test_core_function (push) Failing after 11s
fix nix package install phase for gsf binaries
2026-03-25 14:10:32 +00:00

45 lines
1.0 KiB
Nix

{
lib,
pkgs,
src ? ../.,
}:
let
daemonToml = builtins.fromTOML (builtins.readFile (src + "/daemon/Cargo.toml"));
in
pkgs.rustPlatform.buildRustPackage rec {
pname = "gsf-tools";
version = daemonToml.package.version;
inherit src;
cargoLock.lockFile = src + "/Cargo.lock";
cargoBuildFlags = ["-p" "gsf-cli" "-p" "gsf-daemon"];
doCheck = false;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
gsf_bin="$(find target -type f -path '*/release/gsf' | head -n1)"
gsfd_bin="$(find target -type f -path '*/release/gsfd' | head -n1)"
if [ -z "$gsf_bin" ] || [ -z "$gsfd_bin" ]; then
echo "failed to locate built binaries under target/*/release" >&2
find target -maxdepth 4 -type f | sed -n '1,200p' >&2
exit 1
fi
install -m755 "$gsf_bin" $out/bin/gsf
install -m755 "$gsfd_bin" $out/bin/gsfd
runHook postInstall
'';
meta = with lib; {
description = "gotta-scroll-fast tools (gsf + gsfd)";
license = licenses.gpl2Plus;
platforms = platforms.linux;
};
}