firefly-iii: init at 6.1.13

This commit is contained in:
Savyasachee Jha 2024-04-06 21:07:34 +05:30
parent 370076514b
commit bfad74e57c
3 changed files with 87 additions and 0 deletions

View file

@ -305,6 +305,7 @@ in {
ferm = handleTest ./ferm.nix {};
ferretdb = handleTest ./ferretdb.nix {};
filesystems-overlayfs = runTest ./filesystems-overlayfs.nix;
firefly-iii = handleTest ./firefly-iii.nix {};
firefox = handleTest ./firefox.nix { firefoxPackage = pkgs.firefox; };
firefox-beta = handleTest ./firefox.nix { firefoxPackage = pkgs.firefox-beta; };
firefox-devedition = handleTest ./firefox.nix { firefoxPackage = pkgs.firefox-devedition; };

View file

@ -0,0 +1,26 @@
import ./make-test-python.nix ({ lib, pkgs, ... }: {
name = "firefly-iii";
meta.maintainers = [ lib.maintainers.savyajha ];
nodes.machine = { config, ... }: {
environment.etc = {
"firefly-iii-appkey".text = "TestTestTestTestTestTestTestTest";
};
services.firefly-iii = {
enable = true;
virtualHost = "http://localhost";
enableNginx = true;
settings = {
APP_KEY_FILE = "/etc/firefly-iii-appkey";
LOG_CHANNEL = "stdout";
SITE_OWNER = "mail@example.com";
};
};
};
testScript = ''
machine.wait_for_unit("phpfpm-firefly-iii.service")
machine.wait_for_unit("nginx.service")
machine.succeed("curl -fvvv -Ls http://localhost/ | grep 'Firefly III'")
'';
})

View file

@ -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 ];
};
})