aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/servers/web-apps/engelsystem/default.nix
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
committerMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
commitc4625b175f8200f643fd6e11010932ea44c78433 (patch)
treebce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/servers/web-apps/engelsystem/default.nix
parent49f735974dd103039ddc4cb576bb76555164a9e7 (diff)
parentd661aa56a8843e991261510c1bb28fdc2f6975ae (diff)
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7 git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/servers/web-apps/engelsystem/default.nix')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/web-apps/engelsystem/default.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/web-apps/engelsystem/default.nix b/infra/libkookie/nixpkgs/pkgs/servers/web-apps/engelsystem/default.nix
new file mode 100644
index 000000000000..8ef6a9afa0e8
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/servers/web-apps/engelsystem/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchzip, php, writeText, nixosTests }:
+
+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
+ '';
+
+ passthru.tests = nixosTests.engelsystem;
+
+ 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;
+ };
+}