10 stdenvNoCC.mkDerivation (finalAttrs: {
14 src = fetchFromGitHub {
17 # commit immediately following the v${version} tag
18 # for correct version reporting
19 rev = "44c046176e54fa81e3420a1a40dcd9871e0a45f1";
20 hash = "sha256-cHX6nzajFqygdFF9y4KEAMv0tdNx9xFbpOoVNo8uafs=";
23 backend = buildDotnetModule {
24 pname = "kavita-backend";
25 inherit (finalAttrs) version src;
28 # The webroot is hardcoded as ./wwwroot
30 # Upstream removes database migrations between versions
31 # Restore them to avoid breaking on updates
32 # Info: Restores migrations for versions between v0.7.1.4 and v0.7.9
33 # On update: check if more migrations need to be restored!
34 # Migrations should at least allow updates from previous NixOS versions
35 ./restore-migrations.diff
38 substituteInPlace API/Services/DirectoryService.cs --subst-var out
40 substituteInPlace API/Startup.cs API/Services/LocalizationService.cs API/Controllers/FallbackController.cs \
41 --subst-var-by webroot "${finalAttrs.frontend}/lib/node_modules/kavita-webui/dist/browser"
44 executables = [ "API" ];
46 projectFile = "API/API.csproj";
47 nugetDeps = ./nuget-deps.nix;
48 dotnet-sdk = dotnetCorePackages.sdk_8_0;
49 dotnet-runtime = dotnetCorePackages.aspnetcore_8_0;
52 frontend = buildNpmPackage {
53 pname = "kavita-frontend";
54 inherit (finalAttrs) version src;
56 sourceRoot = "${finalAttrs.src.name}/UI/Web";
58 npmBuildScript = "prod";
59 npmFlags = [ "--legacy-peer-deps" ];
60 npmRebuildFlags = [ "--ignore-scripts" ]; # Prevent playwright from trying to install browsers
61 npmDepsHash = "sha256-H53lwRr43MQWBbwc8N0GikAOkN2N0CwyiY8eGHveNFc=";
69 mkdir -p $out/bin $out/lib/kavita
70 ln -s $backend/lib/kavita-backend $out/lib/kavita/backend
71 ln -s $frontend/lib/node_modules/kavita-webui/dist $out/lib/kavita/frontend
72 ln -s $backend/bin/API $out/bin/kavita
78 tests = { inherit (nixosTests) kavita; };
79 updateScript = ./update.sh;
83 description = "Fast, feature rich, cross platform reading server";
84 homepage = "https://kavitareader.com";
85 changelog = "https://github.com/kareadita/kavita/releases/tag/${finalAttrs.src.rev}";
86 license = lib.licenses.gpl3Only;
87 platforms = lib.platforms.linux;
88 maintainers = with lib.maintainers; [ misterio77 nevivurn ];
89 mainProgram = "kavita";