86 lines
2.1 KiB
Nix
86 lines
2.1 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
stdenvNoCC,
|
|
nodejs,
|
|
fetchNpmDeps,
|
|
buildPackages,
|
|
php84,
|
|
nixosTests,
|
|
nix-update-script,
|
|
dataDir ? "/var/lib/firefly-iii",
|
|
}:
|
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
|
pname = "firefly-iii";
|
|
version = "6.2.21";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "firefly-iii";
|
|
repo = "firefly-iii";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-zyaur3CjSZ8Or2E0rQKubQ440xjwwzJE7i6QXfmn5vk=";
|
|
};
|
|
|
|
buildInputs = [ php84 ];
|
|
|
|
nativeBuildInputs = [
|
|
nodejs
|
|
nodejs.python
|
|
buildPackages.npmHooks.npmConfigHook
|
|
php84.composerHooks2.composerInstallHook
|
|
];
|
|
|
|
composerVendor = php84.mkComposerVendor {
|
|
inherit (finalAttrs) pname src version;
|
|
composerNoDev = true;
|
|
composerNoPlugins = true;
|
|
composerNoScripts = true;
|
|
composerStrictValidation = true;
|
|
strictDeps = true;
|
|
vendorHash = "sha256-mo2oHmFtuY62AcT+ti/zPxxS39a6Qb0cPStyyvyVCag=";
|
|
};
|
|
|
|
npmDeps = fetchNpmDeps {
|
|
inherit (finalAttrs) src;
|
|
name = "${finalAttrs.pname}-npm-deps";
|
|
hash = "sha256-T8Kv4vbr5n+tVQntFEaNozvSu6CKJCA3V256Ml7yzHA=";
|
|
};
|
|
|
|
preInstall = ''
|
|
npm run prod --workspace=v1
|
|
npm run build --workspace=v2
|
|
'';
|
|
|
|
passthru = {
|
|
phpPackage = php84;
|
|
tests = nixosTests.firefly-iii;
|
|
updateScript = nix-update-script {
|
|
extraArgs = [
|
|
"--version-regex"
|
|
"v(\\d+\\.\\d+\\.\\d+)"
|
|
];
|
|
};
|
|
};
|
|
|
|
postInstall = ''
|
|
chmod -R u+w $out/share
|
|
mv $out/share/php/firefly-iii/* $out/
|
|
rm -R $out/share $out/storage $out/bootstrap/cache $out/node_modules
|
|
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${finalAttrs.version}";
|
|
description = "Firefly III: a personal finances manager";
|
|
homepage = "https://github.com/firefly-iii/firefly-iii";
|
|
license = lib.licenses.agpl3Only;
|
|
maintainers = [
|
|
lib.maintainers.savyajha
|
|
lib.maintainers.patrickdag
|
|
];
|
|
hydraPlatforms = lib.platforms.linux; # build hangs on both Darwin platforms, needs investigation
|
|
};
|
|
})
|