1{ pkgs, stdenv, lib, fetchFromGitHub, dataDir ? "/var/lib/bookstack" }:
2
3let
4 package = (import ./composition.nix {
5 inherit pkgs;
6 inherit (stdenv.hostPlatform) system;
7 noDev = true; # Disable development dependencies
8 }).overrideAttrs (attrs : {
9 installPhase = attrs.installPhase + ''
10 rm -R $out/storage $out/public/uploads
11 ln -s ${dataDir}/.env $out/.env
12 ln -s ${dataDir}/storage $out/storage
13 ln -s ${dataDir}/public/uploads $out/public/uploads
14 '';
15 });
16
17in package.override rec {
18 pname = "bookstack";
19 version = "23.01.1";
20
21 src = fetchFromGitHub {
22 owner = "bookstackapp";
23 repo = pname;
24 rev = "v${version}";
25 sha256 = "sha256-S4yGys1Lc2FAd3RKI4KdE9X12rsQyVcPQ+Biwwrnb0I=";
26 };
27
28 meta = with lib; {
29 description = "A platform to create documentation/wiki content built with PHP & Laravel";
30 longDescription = ''
31 A platform for storing and organising information and documentation.
32 Details for BookStack can be found on the official website at https://www.bookstackapp.com/.
33 '';
34 homepage = "https://www.bookstackapp.com/";
35 license = licenses.mit;
36 maintainers = with maintainers; [ ymarkus ];
37 platforms = platforms.linux;
38 };
39}