summaryrefslogtreecommitdiff
path: root/pkgs/crs-tools.nix
diff options
context:
space:
mode:
authorstuebinm2023-04-01 02:54:35 +0200
committerstuebinm2023-04-01 02:54:35 +0200
commitf4f3f7d0ad49cfb9d73061997523f69c31716739 (patch)
tree25fb76ce0d043e59100c46860425791aedbcd3ef /pkgs/crs-tools.nix
parent15c29107417f4c82e534c757a69d36101c506a2a (diff)
add module for crs-tracker, for fun
please no one like, actually use this. unless you volunteer to at least add a script to run database migrations, since currently these need to be run by hand …
Diffstat (limited to 'pkgs/crs-tools.nix')
-rw-r--r--pkgs/crs-tools.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/crs-tools.nix b/pkgs/crs-tools.nix
new file mode 100644
index 0000000..def657c
--- /dev/null
+++ b/pkgs/crs-tools.nix
@@ -0,0 +1,44 @@
+{ stdenv, lib, fetchFromGitHub, system, ... }:
+
+let
+ # we need php < 8; some of the tracker's code is kinda deprecated
+ nixpkgs = fetchFromGitHub {
+ owner = "NixOS";
+ repo = "nixpkgs";
+ rev = "21.05";
+ sha256 = "sha256-ZjBd81a6J3TwtlBr3rHsZspYUwT9OdhDk+a/SgSEf7I=";
+ };
+in
+
+rec {
+ php = (import nixpkgs { inherit system; }).php73.withExtensions
+ (e: with e.all; e.enabled ++ [curl intl mbstring openssl xsl apcu]);
+
+ tracker = stdenv.mkDerivation {
+ pname = "crs-tracker";
+ version = "yolo";
+
+ src = fetchFromGitHub {
+ owner = "crs-tools";
+ repo = "tracker";
+ rev = "7763c665522c7c027ed7f70cba00d7eef47b0644";
+ sha256 = "sha256-MA04yiDLquKmiJ/6kUXigFPt7JtNB7/HI9SA60bRhH0=";
+ fetchSubmodules = true;
+ };
+
+ patches = [
+ ./0001-add-lockfile.patch
+ ];
+
+ buildInputs = [ php php.packages.composer ];
+
+ buildPhase = ''
+ composer install --ignore-platform-req=ext-xdiff --ignore-platform-req=ext-xmlrpc
+ '';
+
+ installPhase = ''
+ mkdir -p $out
+ cp -r * $out
+ '';
+ };
+}