11 stdenvNoCC.mkDerivation (finalAttrs: {
15 src = fetchFromGitHub {
18 rev = "v${finalAttrs.version}";
19 hash = "sha256-iJ9ocTWcKSUvgN48s5a2N2tz83uid2N4vg1bHAQmnH4=";
22 backend = buildDotnetModule {
23 pname = "kavita-backend";
24 inherit (finalAttrs) version src;
27 # The webroot is hardcoded as ./wwwroot
29 # Upstream removes database migrations between versions
30 # Restore them to avoid breaking on updates
31 # Info: Restores migrations for versions between v0.7.1.4 and v0.7.9
32 # On update: check if more migrations need to be restored!
33 # Migrations should at least allow updates from previous NixOS versions
34 ./restore-migrations.diff
37 substituteInPlace API/Services/DirectoryService.cs --subst-var out
39 substituteInPlace API/Startup.cs API/Services/LocalizationService.cs API/Controllers/FallbackController.cs \
40 --subst-var-by webroot "${finalAttrs.frontend}/lib/node_modules/kavita-webui/dist/browser"
43 executables = [ "API" ];
45 projectFile = "API/API.csproj";
46 nugetDeps = ./nuget-deps.json;
47 dotnet-sdk = dotnetCorePackages.sdk_8_0;
48 dotnet-runtime = dotnetCorePackages.aspnetcore_8_0;
51 frontend = buildNpmPackage {
52 pname = "kavita-frontend";
53 inherit (finalAttrs) version src;
55 sourceRoot = "${finalAttrs.src.name}/UI/Web";
57 npmBuildScript = "prod";
58 npmFlags = [ "--legacy-peer-deps" ];
59 npmRebuildFlags = [ "--ignore-scripts" ]; # Prevent playwright from trying to install browsers
60 npmDepsHash = "sha256-ttEAoLg8OmA4lA7IJS4+5QwpMJdFIoJrWZryFhTZUdI=";
68 mkdir -p $out/bin $out/lib/kavita
69 ln -s $backend/lib/kavita-backend $out/lib/kavita/backend
70 ln -s $frontend/lib/node_modules/kavita-webui/dist $out/lib/kavita/frontend
71 ln -s $backend/bin/API $out/bin/kavita
78 inherit (nixosTests) kavita;
80 updateScript = ./update.sh;
84 description = "Fast, feature rich, cross platform reading server";
85 homepage = "https://kavitareader.com";
86 changelog = "https://github.com/kareadita/kavita/releases/tag/${finalAttrs.src.rev}";
87 license = lib.licenses.gpl3Only;
88 platforms = lib.platforms.linux;
89 maintainers = with lib.maintainers; [
93 mainProgram = "kavita";