nixpkgs/pkgs/servers/fishnet/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.1 KiB
Nix
Raw Normal View History

2021-01-27 19:01:09 +00:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, fetchurl
}:
2021-01-27 19:01:09 +00:00
let
2023-10-24 23:34:03 +00:00
nnueFile = "nn-5af11540bbfe.nnue";
nnue = fetchurl {
url = "https://tests.stockfishchess.org/api/nn/${nnueFile}";
2023-10-24 23:34:03 +00:00
hash = "sha256-WvEVQLv+/LVOOMXdAAyrS0ad+nWZodVb5dJyLCCokps=";
2021-01-27 19:01:09 +00:00
};
in
rustPlatform.buildRustPackage rec {
pname = "fishnet";
2023-10-24 23:34:03 +00:00
version = "2.7.1";
2021-01-27 19:01:09 +00:00
src = fetchFromGitHub {
2023-10-24 23:34:03 +00:00
owner = "lichess-org";
2021-01-27 19:01:09 +00:00
repo = pname;
rev = "v${version}";
2023-10-24 23:34:03 +00:00
hash = "sha256-q73oGQYSWx1aFy9IvbGpecOoc0wLEY2IzJH9GufnvCs=";
fetchSubmodules = true;
2021-01-27 19:01:09 +00:00
};
postPatch = ''
cp -v '${nnue}' 'Stockfish/src/${nnueFile}'
cp -v '${nnue}' 'Fairy-Stockfish/src/${nnueFile}'
2021-01-27 19:01:09 +00:00
'';
2023-10-24 23:34:03 +00:00
# Copying again bacause the file is deleted during build.
postBuild = ''
cp -v '${nnue}' 'Stockfish/src/${nnueFile}'
'';
2022-02-19 23:18:48 +00:00
2023-10-24 23:34:03 +00:00
cargoHash = "sha256-NO3u2ZXSiDQnZ/FFZLOtTnQoGMyN9pSI4sqGIXtjEcI=";
2021-02-27 17:26:42 +00:00
2021-01-27 19:01:09 +00:00
meta = with lib; {
description = "Distributed Stockfish analysis for lichess.org";
2023-10-24 23:34:03 +00:00
homepage = "https://github.com/lichess-org/fishnet";
2021-01-27 19:01:09 +00:00
license = licenses.gpl3Plus;
maintainers = with maintainers; [ tu-maurice ];
2023-10-24 23:34:03 +00:00
platforms = [ "aarch64-linux" "x86_64-linux" ];
2021-01-27 19:01:09 +00:00
};
}