2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildNpmPackage
|
|
|
|
, php83
|
|
|
|
, nixosTests
|
|
|
|
, dataDir ? "/var/lib/firefly-iii"
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "firefly-iii";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "6.1.16";
|
2024-04-21 15:54:59 +00:00
|
|
|
phpPackage = php83;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "firefly-iii";
|
|
|
|
repo = "firefly-iii";
|
|
|
|
rev = "v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-1I4Wm10mmloqeWcpc4XloNATpvroiw6m8MiSVsoB6xo=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
assets = buildNpmPackage {
|
|
|
|
pname = "${pname}-assets";
|
|
|
|
inherit version src;
|
2024-06-05 15:53:02 +00:00
|
|
|
npmDepsHash = "sha256-Ff7pDKoXvyj/gR+ljQsCjtyzxzJ7/zN6hRMEAderqOg=";
|
2024-04-21 15:54:59 +00:00
|
|
|
dontNpmBuild = true;
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2024-05-15 15:35:15 +00:00
|
|
|
npm run prod --workspace=v1
|
|
|
|
npm run build --workspace=v2
|
2024-04-21 15:54:59 +00:00
|
|
|
cp -r ./public $out/
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
phpPackage.buildComposerProject (finalAttrs: {
|
|
|
|
inherit pname src version;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
vendorHash = "sha256-BanSEqE3KN46VtEZH0TVWUBrgPCwmd2TjheYq+e+lzo=";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
})
|