From cfa982c06556eb4ff598048db7a97828e9eff275 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Wed, 15 Oct 2025 08:00:34 +0200 Subject: [PATCH] invoiceplane: init at 1.7.0 --- .../in/invoiceplane/fix-yarn-lockfile.patch | 19 +++++ pkgs/by-name/in/invoiceplane/package.nix | 80 +++++++++++++++++++ pkgs/top-level/aliases.nix | 1 - 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/in/invoiceplane/fix-yarn-lockfile.patch create mode 100644 pkgs/by-name/in/invoiceplane/package.nix diff --git a/pkgs/by-name/in/invoiceplane/fix-yarn-lockfile.patch b/pkgs/by-name/in/invoiceplane/fix-yarn-lockfile.patch new file mode 100644 index 000000000000..dc25725398f5 --- /dev/null +++ b/pkgs/by-name/in/invoiceplane/fix-yarn-lockfile.patch @@ -0,0 +1,19 @@ +diff --git a/yarn.lock b/yarn.lock +index 227d51e2..11c80f04 100644 +--- a/yarn.lock ++++ b/yarn.lock +@@ -1397,10 +1397,10 @@ safe-json-parse@~1.0.1: + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +-sass@^1.89.2: +- version "1.97.2" +- resolved "https://registry.yarnpkg.com/sass/-/sass-1.97.2.tgz#e515a319092fd2c3b015228e3094b40198bff0da" +- integrity sha512-y5LWb0IlbO4e97Zr7c3mlpabcbBtS+ieiZ9iwDooShpFKWXf62zz5pEPdwrLYm+Bxn1fnbwFGzHuCLSA9tBmrw== ++sass@^1.97: ++ version "1.97.3" ++ resolved "https://registry.yarnpkg.com/sass/-/sass-1.97.3.tgz#9cb59339514fa7e2aec592b9700953ac6e331ab2" ++ integrity sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg== + dependencies: + chokidar "^4.0.0" + immutable "^5.0.2" diff --git a/pkgs/by-name/in/invoiceplane/package.nix b/pkgs/by-name/in/invoiceplane/package.nix new file mode 100644 index 000000000000..a0b8b6faf144 --- /dev/null +++ b/pkgs/by-name/in/invoiceplane/package.nix @@ -0,0 +1,80 @@ +{ + lib, + fetchFromGitHub, + nixosTests, + fetchYarnDeps, + applyPatches, + php, + yarnConfigHook, + yarnBuildHook, + yarnInstallHook, + grunt-cli, + fetchzip, +}: +let + version = "1.7.0"; + # Fetch release tarball which contains language files + # https://github.com/InvoicePlane/InvoicePlane/issues/1170 + languages = fetchzip { + #url = "https://github.com/InvoicePlane/InvoicePlane/releases/download/v${version}/v${version}.zip"; + url = "https://github.com/InvoicePlane/InvoicePlane/releases/download/v1.7.0/v1.7.0.zip"; + hash = "sha256-D5wZg745xjbBsEPUbvle8ynErFB4xn9zdxOGh0xKCCU="; + }; +in +php.buildComposerProject2 (finalAttrs: { + pname = "invoiceplane"; + inherit version; + + src = fetchFromGitHub { + owner = "InvoicePlane"; + repo = "InvoicePlane"; + tag = "v${version}"; + hash = "sha256-6fuUmXe8mFSnLYwQCwBzxmSQxM06rQXe00IKUZvWnpM="; + }; + + # Fixes error: Couldn't find any versions for "sass" that matches "^1.97" in our cache + patches = [ ./fix-yarn-lockfile.patch ]; + + # Composer.lock validation currently fails for unknown reason + composerStrictValidation = false; + + vendorHash = "sha256-/fNVq3WJCr9f/NE0s1x8N48W3ZMRUxdh1Qf3pLl0Lpg="; + + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + yarnInstallHook + # Needed for executing package.json scripts + grunt-cli + ]; + + offlineCache = fetchYarnDeps { + inherit (finalAttrs) src patches; + hash = "sha256-YDknkQzdRKRRMXS6/cPRSrfhhIyTIDRnFPNGQueu74A="; + }; + + postBuild = '' + grunt build + ''; + + # Cleanup and language files + postInstall = '' + chmod -R u+w $out/share + mv $out/share/php/invoiceplane/* $out/ + cp -r ${languages}/application/language $out/application/ + rm -r $out/{composer.json,composer.lock,CONTRIBUTING.md,docker-compose.yml,Gruntfile.js,package.json,node_modules,yarn.lock,share} + ''; + + passthru.tests = { + inherit (nixosTests) invoiceplane; + }; + + meta = { + description = "Self-hosted open source application for managing your invoices, clients and payments"; + changelog = "https://github.com/InvoicePlane/InvoicePlane/releases/tag/v${version}"; + homepage = "https://www.invoiceplane.com"; + license = lib.licenses.mit; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ onny ]; + }; +}) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index ff99201372f2..19344be2a428 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -882,7 +882,6 @@ mapAliases { inotifyTools = throw "'inotifyTools' has been renamed to/replaced by 'inotify-tools'"; # Converted to throw 2025-10-27 insync-emblem-icons = throw "'insync-emblem-icons' has been removed, use 'insync-nautilus' instead"; # Added 2025-05-14 invalidateFetcherByDrvHash = throw "'invalidateFetcherByDrvHash' has been renamed to/replaced by 'testers.invalidateFetcherByDrvHash'"; # Converted to throw 2025-10-27 - invoiceplane = throw "'invoiceplane' doesn't support non-EOL PHP versions"; # Added 2025-10-03 ioccheck = throw "ioccheck was dropped since it was unmaintained."; # Added 2025-07-06 ipfs = throw "'ipfs' has been renamed to/replaced by 'kubo'"; # Converted to throw 2025-10-27 ipfs-migrator = throw "'ipfs-migrator' has been renamed to/replaced by 'kubo-migrator'"; # Converted to throw 2025-10-27