about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2024-04-20 13:56:08 +0200
committerGitHub <noreply@github.com>2024-04-20 13:56:08 +0200
commite5406985244d20363216659894f925dbb31afa8c (patch)
tree08e9b370e4208efe7cc528b5e9c8fc04eac2c037 /pkgs
parentdd892fecf1999f3ac449fb44542ab884feaa56b2 (diff)
parent7531099464e3d6863fd4a39a2d0a186bb2ce4c2d (diff)
Merge pull request #302136 from savyajha/firefly-iii
firefly-iii: init at 6.1.13, nixos/firefly-iii: init
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/fi/firefly-iii/package.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/by-name/fi/firefly-iii/package.nix b/pkgs/by-name/fi/firefly-iii/package.nix
new file mode 100644
index 0000000000000..850bb85755d65
--- /dev/null
+++ b/pkgs/by-name/fi/firefly-iii/package.nix
@@ -0,0 +1,60 @@
+{ lib
+, fetchFromGitHub
+, buildNpmPackage
+, php83
+, nixosTests
+, dataDir ? "/var/lib/firefly-iii"
+}:
+
+let
+  pname = "firefly-iii";
+  version = "6.1.13";
+  phpPackage = php83;
+
+  src = fetchFromGitHub {
+    owner = "firefly-iii";
+    repo = "firefly-iii";
+    rev = "v${version}";
+    hash = "sha256-85zI8uCyyoCflzxDkvba6FWa9B3kh179DJfQ2Um6MGM=";
+  };
+
+  assets = buildNpmPackage {
+    pname = "${pname}-assets";
+    inherit version src;
+    npmDepsHash = "sha256-wuPUE6XuzzgKjpxZVgwh2wGut15M61WSBFG+YIZwOFM=";
+    dontNpmBuild = true;
+    installPhase = ''
+      runHook preInstall
+      npm run build
+      cp -r ./public $out/
+      runHook postInstall
+    '';
+  };
+in
+
+phpPackage.buildComposerProject (finalAttrs: {
+  inherit pname src version;
+
+  vendorHash = "sha256-CVGKyyLp5hjjpEulDNEYfljU4OgPBaFcYQQAUf6GeGs=";
+
+  passthru = {
+    inherit phpPackage;
+    tests = nixosTests.firefly-iii;
+  };
+
+  postInstall = ''
+    mv $out/share/php/${pname}/* $out/
+    rm -R $out/share $out/storage $out/bootstrap/cache $out/public
+    cp -a ${assets} $out/public
+    ln -s ${dataDir}/storage $out/storage
+    ln -s ${dataDir}/cache $out/bootstrap/cache
+  '';
+
+  meta = {
+    changelog = "https://github.com/firefly-iii/firefly-iii/releases/tag/v${version}";
+    description = "Firefly III: a personal finances manager";
+    homepage = "https://github.com/firefly-iii/firefly-iii";
+    license = lib.licenses.agpl3Only;
+    maintainers = [ lib.maintainers.savyajha ];
+  };
+})