nixos/pkgs/rayfish.nix

36 lines
904 B
Nix
Raw Normal View History

2026-07-11 19:38:30 +02:00
{
fetchFromGitHub,
rustPlatform,
}:
let
sources = import ../npins/default.nix;
rayfish-repo = sources.rayfish;
in
2026-07-11 19:38:30 +02:00
rustPlatform.buildRustPackage {
pname = "rayfish";
version = "0.2.0";
src = fetchFromGitHub {
owner = rayfish-repo.repository.owner;
repo = rayfish-repo.repository.repo;
tag = rayfish-repo.version;
hash = rayfish-repo.hash;
2026-07-11 19:38:30 +02:00
};
cargoHash = "sha256-mh4lGbI3GUH32vf0FwVqyh737gCM7nEphQJr1rQed48=";
doCheck = false;
installPhase = /* bash */ ''
runHook installPhase
mkdir -p $out/bin/
mkdir -p $out/lib/systemd/system/
# Copy binary and service to out
cp ./target/x86_64-unknown-linux-gnu/release/ray $out/bin/
cp ./contrib/rayfish.service $out/lib/systemd/system/
# Patch binary path in service file to match derivation path
sed -i "s|/usr/local/bin/ray|$out/bin/ray|g" $out/lib/systemd/system/rayfish.service
'';
}