about summary refs log tree commit diff
path: root/pkgs/servers/web-apps
diff options
context:
space:
mode:
authorFinn Behrens <me@kloenk.de>2020-03-16 23:01:23 +0100
committerFinn Behrens <me@kloenk.de>2020-05-21 15:56:56 +0200
commit829ebc53901c1c1e06eb4612888b34abd5479084 (patch)
tree6fedca711ac5f2901d22d23a1efb0af3a791963e /pkgs/servers/web-apps
parenta31de7bf862fe2858e17b587cac5821c460253d6 (diff)
downloadnixlib-829ebc53901c1c1e06eb4612888b34abd5479084.tar
nixlib-829ebc53901c1c1e06eb4612888b34abd5479084.tar.gz
nixlib-829ebc53901c1c1e06eb4612888b34abd5479084.tar.bz2
nixlib-829ebc53901c1c1e06eb4612888b34abd5479084.tar.lz
nixlib-829ebc53901c1c1e06eb4612888b34abd5479084.tar.xz
nixlib-829ebc53901c1c1e06eb4612888b34abd5479084.tar.zst
nixlib-829ebc53901c1c1e06eb4612888b34abd5479084.zip
engelsystem: init at version 3.1.0
Diffstat (limited to 'pkgs/servers/web-apps')
-rw-r--r--pkgs/servers/web-apps/engelsystem/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/servers/web-apps/engelsystem/default.nix b/pkgs/servers/web-apps/engelsystem/default.nix
new file mode 100644
index 000000000000..b7dca2cdd7bb
--- /dev/null
+++ b/pkgs/servers/web-apps/engelsystem/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchzip, php, writeText }:
+
+let
+  phpExt = php.withExtensions
+    ({ enabled, all }: with all; [ json filter mysqlnd mysqli pdo pdo_mysql ]);
+in stdenv.mkDerivation rec {
+  pname = "engelsystem";
+  version = "3.1.0";
+
+  src = fetchzip {
+    url =
+      "https://github.com/engelsystem/engelsystem/releases/download/v3.1.0/engelsystem-v3.1.0.zip";
+    sha256 = "01wra7li7n5kn1l6xkrmw4vlvvyqh089zs43qzn98hj0mw8gw7ai";
+    # This is needed, because the zip contains a directory with world write access, which is not allowed in nix
+    extraPostFetch = "chmod -R a-w $out";
+  };
+
+  buildInputs = [ phpExt ];
+
+  installPhase = ''
+    runHook preInstall
+
+    # prepare
+    rm -r ./storage/
+    rm -r ./docker/
+
+    ln -sf /etc/engelsystem/config.php ./config/config.php
+    ln -sf /var/lib/engelsystem/storage/ ./storage
+
+    mkdir -p $out/share/engelsystem
+    mkdir -p $out/bin
+    cp -r . $out/share/engelsystem
+
+    echo $(command -v php)
+    # The patchShebangAuto function always used the php without extensions, so path the shebang manually
+    sed -i -e "1 s|.*|#\!${phpExt}/bin/php|" "$out/share/engelsystem/bin/migrate"
+    ln -s "$out/share/engelsystem/bin/migrate" "$out/bin/migrate"
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description =
+      "Coordinate your helpers in teams, assign them to work shifts or let them decide for themselves when and where they want to help with what";
+    license = licenses.gpl2;
+    homepage = "https://engelsystem.de";
+    maintainers = with maintainers; [ kloenk ];
+    platforms = platforms.all;
+  };
+}