fix: update firefly to fix

This commit is contained in:
Patrick 2024-06-17 21:32:25 +02:00
parent 6d668c80c0
commit c3900591be
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
3 changed files with 60 additions and 0 deletions

View file

@ -9,6 +9,7 @@
deploy = super.callPackage ./deploy.nix {};
minify = super.callPackage ./minify {};
j-link = super.callPackage ./jlink.nix {};
firefly-iii = super.callPackage ./firefly-iii.nix {};
mongodb-bin = super.callPackage ./mongodb-bin.nix {};
awakened-poe-trade = super.callPackage ./awakened-poe-trade.nix {};
neovim-clean = super.neovim-unwrapped.overrideAttrs (_neovimFinal: neovimPrev: {

59
pkgs/firefly-iii.nix Normal file
View file

@ -0,0 +1,59 @@
{
lib,
fetchFromGitHub,
buildNpmPackage,
php83,
nixosTests,
dataDir ? "/var/lib/firefly-iii",
}: let
pname = "firefly-iii";
version = "6.1.18";
phpPackage = php83;
src = fetchFromGitHub {
owner = "firefly-iii";
repo = "firefly-iii";
rev = "v${version}";
hash = "sha256-mA7gvKhHouUUz1Aix7253O/+VcufoEFwdcJeZxnazEo=";
};
assets = buildNpmPackage {
pname = "${pname}-assets";
inherit version src;
npmDepsHash = "sha256-MoxkNxfVeIFkiNVzfehQ9FpC65kBj8ZmvwaRf4MVRIg=";
dontNpmBuild = true;
installPhase = ''
runHook preInstall
npm run prod --workspace=v1
npm run build --workspace=v2
cp -r ./public $out/
runHook postInstall
'';
};
in
phpPackage.buildComposerProject (_: {
inherit pname src version;
vendorHash = "sha256-EpMypgj6lZDz6T94bGoCUH9IVwh7VB4Ds08AcCsreRw=";
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];
};
})