shoko-nix/pkg.nix

48 lines
1.6 KiB
Nix

{ lib
, callPackage
, fetchFromGitHub
, buildDotnetModule
, dotnetCorePackages
, dotnet-aspnetcore
# , mediainfo
# , rhash
}:
# FIXME: the build docs say we need mediainfo and rhash and this seems plausible, but nothing's broken yet. Runtime deps?
# FIXME: all data/state files are stored in ~/.shoko, rather than somewhere more standard
# FIXME: it expects files for the web UI to be stored in a folder `webui/` in the same directory as the executable. (yes, really.)
# it gets these from: https://github.com/ShokoAnime/Shoko-WebUI/releases/download/${latest}/latest.zip
# which appears to be a prebuilt version of whatever is in the repository. I'm not sure if I even should fix this?
# If not found, it downloads it to ~/.shoko/webui
buildDotnetModule rec {
pname = "shoko-server";
version = "4.2.2";
src = fetchFromGitHub {
owner = "ShokoAnime";
repo = "ShokoServer";
rev = "v${version}";
sha256 = "sha256-lWI81sRSYs/CukyylwssB96kxSqxMFxiD30WW2xi05s=";
fetchSubmodules = true;
};
# strictDeps = true;
# nativeBuildInputs = [ mediainfo rhash ];
projectFile = "Shoko.CLI/Shoko.CLI.csproj";
nugetDeps = ./deps.nix;
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-runtime = dotnet-aspnetcore; # 6.0
executables = [ "Shoko.CLI" ];
meta = {
homepage = "https://shokoanime.com/";
changelog = "https://github.com/ShokoAnime/ShokoServer/releases/tag/v${version}";
license = lib.licenses.mit;
platforms = [ "x86_64-linux" ]; # some people have reported success on other platforms but this (and Windows) are the only supported ones
mainProgram = "Shoko.CLI";
};
}