From 60963ed2fe4303ba34131de1127b6b0e36eb6369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Dami=C3=A1n=20Schonborn?= Date: Sat, 30 Mar 2024 21:55:19 -0300 Subject: [PATCH 001/101] waycheck: 1.1.1 -> 1.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Federico Damián Schonborn --- pkgs/by-name/wa/waycheck/package.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/wa/waycheck/package.nix b/pkgs/by-name/wa/waycheck/package.nix index ddbd67e88220..4ac98f6a640f 100644 --- a/pkgs/by-name/wa/waycheck/package.nix +++ b/pkgs/by-name/wa/waycheck/package.nix @@ -12,14 +12,14 @@ stdenv.mkDerivation (finalAttrs: { pname = "waycheck"; - version = "1.1.1"; + version = "1.2.0"; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; owner = "serebit"; repo = "waycheck"; rev = "v${finalAttrs.version}"; - hash = "sha256-kwkdTMA15oJHz9AXEkBGeuzYdEUpNuv/xnhzoKOHCE4="; + hash = "sha256-sDfIR+F2W59mh50jXoOrcNZ1nuckm3r7jN613BH4Eog="; }; nativeBuildInputs = [ @@ -38,13 +38,14 @@ stdenv.mkDerivation (finalAttrs: { dontWrapGApps = true; - preFixup = '' - qtWrapperArgs+=("''${gappsWrapperArgs[@]}") + postPatch = '' + substituteInPlace scripts/mesonPostInstall.sh \ + --replace-fail "#!/usr/bin/env sh" "#!${stdenv.shell}" \ + --replace-fail "update-desktop-database -q" "update-desktop-database $out/share/applications" ''; - preInstall = '' - substituteInPlace ../scripts/mesonPostInstall.sh \ - --replace "update-desktop-database -q" "update-desktop-database $out/share/applications" + preFixup = '' + qtWrapperArgs+=("''${gappsWrapperArgs[@]}") ''; meta = { From b84396e9a37c5ea5ee5dd9aad6efdb9b34081706 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 11 Apr 2024 14:48:50 +0000 Subject: [PATCH 002/101] python311Packages.cloudsmith-api: 2.0.12 -> 2.0.13 --- pkgs/development/python-modules/cloudsmith-api/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/cloudsmith-api/default.nix b/pkgs/development/python-modules/cloudsmith-api/default.nix index 5f51009f4bd7..e49a0eb5f92f 100644 --- a/pkgs/development/python-modules/cloudsmith-api/default.nix +++ b/pkgs/development/python-modules/cloudsmith-api/default.nix @@ -10,7 +10,7 @@ buildPythonPackage rec { pname = "cloudsmith-api"; - version = "2.0.12"; + version = "2.0.13"; format = "wheel"; disabled = pythonOlder "3.7"; @@ -18,7 +18,7 @@ buildPythonPackage rec { src = fetchPypi { pname = "cloudsmith_api"; inherit format version; - hash = "sha256-a33t963Q5+gnZI9pha4viuyWz3xLHUdcGE4ccw/w0s8="; + hash = "sha256-xPPARaxclTRy7thJXtXaMK0F5/91q7o35LyzSmx1HPU="; }; propagatedBuildInputs = [ From a324aaf7daeb533b1f1b110158810ca626dd2794 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 11 Apr 2024 15:22:59 +0000 Subject: [PATCH 003/101] python311Packages.qtile: 0.24.0 -> 0.25.0 --- pkgs/development/python-modules/qtile/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/qtile/default.nix b/pkgs/development/python-modules/qtile/default.nix index 09a0c21a1f88..063b134344c4 100644 --- a/pkgs/development/python-modules/qtile/default.nix +++ b/pkgs/development/python-modules/qtile/default.nix @@ -32,14 +32,14 @@ buildPythonPackage rec { pname = "qtile"; - version = "0.24.0"; + version = "0.25.0"; format = "setuptools"; src = fetchFromGitHub { owner = "qtile"; repo = "qtile"; - rev = "v${version}"; - hash = "sha256-mgMRkoKT0Gp5/OfVQbkeDTkg9QRFn4PU3ziM5E6V+oI="; + rev = "refs/tags/v${version}"; + hash = "sha256-j5hpXfUSDUT9nBr6CafIzqdTYQxSWok+ZlQA7bGdVvk="; }; patches = [ From 98a1ba07bfdb702fe77627563476ffd8f1ffcd93 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 12 Apr 2024 14:39:07 +0000 Subject: [PATCH 004/101] python312Packages.pyprecice: 3.0.0.0 -> 3.1.0 --- pkgs/development/python-modules/pyprecice/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pyprecice/default.nix b/pkgs/development/python-modules/pyprecice/default.nix index f6c5d8fc2387..b390314dd981 100644 --- a/pkgs/development/python-modules/pyprecice/default.nix +++ b/pkgs/development/python-modules/pyprecice/default.nix @@ -11,7 +11,7 @@ buildPythonPackage rec { pname = "pyprecice"; - version = "3.0.0.0"; + version = "3.1.0"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -20,7 +20,7 @@ buildPythonPackage rec { owner = "precice"; repo = "python-bindings"; rev = "refs/tags/v${version}"; - hash = "sha256-iW3Mll28Z3Ew+eIJxeF1HR7JhVhXs9FiYaAb5TwYSpg="; + hash = "sha256-5K6oVBhR6mBdkyOb/Ec0qg9x63tkoTnLIrE8dz8oCtc="; }; nativeBuildInputs = [ From bfad74e57c385853290a6199223d77110b731e2c Mon Sep 17 00:00:00 2001 From: Savyasachee Jha Date: Sat, 6 Apr 2024 21:07:34 +0530 Subject: [PATCH 005/101] firefly-iii: init at 6.1.13 --- nixos/tests/all-tests.nix | 1 + nixos/tests/firefly-iii.nix | 26 +++++++++++ pkgs/by-name/fi/firefly-iii/package.nix | 60 +++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 nixos/tests/firefly-iii.nix create mode 100644 pkgs/by-name/fi/firefly-iii/package.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index bc586a609271..a901bfb591a4 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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; }; diff --git a/nixos/tests/firefly-iii.nix b/nixos/tests/firefly-iii.nix new file mode 100644 index 000000000000..c93d799320a4 --- /dev/null +++ b/nixos/tests/firefly-iii.nix @@ -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'") + ''; +}) diff --git a/pkgs/by-name/fi/firefly-iii/package.nix b/pkgs/by-name/fi/firefly-iii/package.nix new file mode 100644 index 000000000000..850bb85755d6 --- /dev/null +++ b/pkgs/by-name/fi/firefly-iii/package.nix @@ -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 ]; + }; +}) From 7531099464e3d6863fd4a39a2d0a186bb2ce4c2d Mon Sep 17 00:00:00 2001 From: Savyasachee Jha Date: Sat, 6 Apr 2024 21:08:00 +0530 Subject: [PATCH 006/101] nixos/firefly-iii: init --- .../manual/release-notes/rl-2405.section.md | 2 + nixos/modules/module-list.nix | 1 + .../modules/services/web-apps/firefly-iii.nix | 367 ++++++++++++++++++ 3 files changed, 370 insertions(+) create mode 100644 nixos/modules/services/web-apps/firefly-iii.nix diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index e66eaae9d5a5..c9771419e704 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -151,6 +151,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - [davis](https://github.com/tchapi/davis), a simple CardDav and CalDav server inspired by Baïkal. Available as [services.davis]($opt-services-davis.enable). +- [Firefly-iii](https://www.firefly-iii.org), a free and open source personal finance manager. Available as [services.firefly-iii](#opt-services.firefly-iii.enable) + - [systemd-lock-handler](https://git.sr.ht/~whynothugo/systemd-lock-handler/), a bridge between logind D-Bus events and systemd targets. Available as [services.systemd-lock-handler.enable](#opt-services.systemd-lock-handler.enable). - [wastebin](https://github.com/matze/wastebin), a pastebin server written in rust. Available as [services.wastebin](#opt-services.wastebin.enable). diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d4e0e689e28c..3659410ef832 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1320,6 +1320,7 @@ ./services/web-apps/dolibarr.nix ./services/web-apps/engelsystem.nix ./services/web-apps/ethercalc.nix + ./services/web-apps/firefly-iii.nix ./services/web-apps/fluidd.nix ./services/web-apps/freshrss.nix ./services/web-apps/galene.nix diff --git a/nixos/modules/services/web-apps/firefly-iii.nix b/nixos/modules/services/web-apps/firefly-iii.nix new file mode 100644 index 000000000000..b0024ce09c38 --- /dev/null +++ b/nixos/modules/services/web-apps/firefly-iii.nix @@ -0,0 +1,367 @@ +{ pkgs, config, lib, ... }: + +let + inherit (lib) optionalString mkDefault mkIf mkOption mkEnableOption literalExpression; + inherit (lib.types) nullOr attrsOf oneOf str int bool path package enum submodule; + inherit (lib.strings) concatMapStringsSep removePrefix toShellVars removeSuffix hasSuffix; + inherit (lib.attrsets) attrValues genAttrs filterAttrs mapAttrs' nameValuePair; + inherit (builtins) isInt isString toString typeOf; + + cfg = config.services.firefly-iii; + + user = cfg.user; + group = cfg.group; + + defaultUser = "firefly-iii"; + defaultGroup = "firefly-iii"; + + artisan = "${cfg.package}/artisan"; + + env-file-values = mapAttrs' (n: v: nameValuePair (removeSuffix "_FILE" n) v) + (filterAttrs (n: v: hasSuffix "_FILE" n) cfg.settings); + env-nonfile-values = filterAttrs (n: v: ! hasSuffix "_FILE" n) cfg.settings; + + envfile = pkgs.writeText "firefly-iii-env" '' + ${toShellVars env-file-values} + ${toShellVars env-nonfile-values} + ''; + + fileenv-func = '' + cp --no-preserve=mode ${envfile} /tmp/firefly-iii-env + ${concatMapStringsSep "\n" + (n: "${pkgs.replace-secret}/bin/replace-secret ${n} ${n} /tmp/firefly-iii-env") + (attrValues env-file-values)} + set -a + . /tmp/firefly-iii-env + set +a + ''; + + firefly-iii-maintenance = pkgs.writeShellScript "firefly-iii-maintenance.sh" '' + ${fileenv-func} + + ${optionalString (cfg.settings.DB_CONNECTION == "sqlite") + "touch ${cfg.dataDir}/storage/database/database.sqlite"} + ${artisan} migrate --seed --no-interaction --force + ${artisan} firefly-iii:decrypt-all + ${artisan} firefly-iii:upgrade-database + ${artisan} firefly-iii:correct-database + ${artisan} firefly-iii:report-integrity + ${artisan} firefly-iii:laravel-passport-keys + ${artisan} cache:clear + + mv /tmp/firefly-iii-env /run/phpfpm/firefly-iii-env + ''; + + commonServiceConfig = { + Type = "oneshot"; + User = user; + Group = group; + StateDirectory = "${removePrefix "/var/lib/" cfg.dataDir}"; + WorkingDirectory = cfg.package; + PrivateTmp = true; + PrivateDevices = true; + CapabilityBoundingSet = ""; + AmbientCapabilities = ""; + ProtectSystem = "strict"; + ProtectKernelTunables = true; + ProtectKernelModules = true; + ProtectControlGroups = true; + ProtectClock = true; + ProtectHostname = true; + ProtectHome = "tmpfs"; + ProtectKernelLogs = true; + ProtectProc = "invisible"; + ProcSubset = "pid"; + PrivateNetwork = false; + RestrictAddressFamilies = "AF_INET AF_INET6 AF_UNIX"; + SystemCallArchitectures = "native"; + SystemCallFilter = [ + "@system-service @resources" + "~@obsolete @privileged" + ]; + RestrictSUIDSGID = true; + RemoveIPC = true; + NoNewPrivileges = true; + RestrictRealtime = true; + RestrictNamespaces = true; + LockPersonality = true; + PrivateUsers = true; + }; + +in { + + options.services.firefly-iii = { + + enable = mkEnableOption "Firefly III: A free and open source personal finance manager"; + + user = mkOption { + type = str; + default = defaultUser; + description = "User account under which firefly-iii runs."; + }; + + group = mkOption { + type = str; + default = if cfg.enableNginx then "nginx" else defaultGroup; + defaultText = "If `services.firefly-iii.enableNginx` is true then `nginx` else ${defaultGroup}"; + description = '' + Group under which firefly-iii runs. It is best to set this to the group + of whatever webserver is being used as the frontend. + ''; + }; + + dataDir = mkOption { + type = path; + default = "/var/lib/firefly-iii"; + description = '' + The place where firefly-iii stores its state. + ''; + }; + + package = mkOption { + type = package; + default = pkgs.firefly-iii; + defaultText = literalExpression "pkgs.firefly-iii"; + description = '' + The firefly-iii package served by php-fpm and the webserver of choice. + This option can be used to point the webserver to the correct root. It + may also be used to set the package to a different version, say a + development version. + ''; + apply = firefly-iii : firefly-iii.override (prev: { + dataDir = cfg.dataDir; + }); + }; + + enableNginx = mkOption { + type = bool; + default = false; + description = '' + Whether to enable nginx or not. If enabled, an nginx virtual host will + be created for access to firefly-iii. If not enabled, then you may use + `''${config.services.firefly-iii.package}` as your document root in + whichever webserver you wish to setup. + ''; + }; + + virtualHost = mkOption { + type = str; + description = '' + The hostname at which you wish firefly-iii to be served. If you have + enabled nginx using `services.firefly-iii.enableNginx` then this will + be used. + ''; + }; + + poolConfig = mkOption { + type = attrsOf (oneOf [ str int bool ]); + default = { + "pm" = "dynamic"; + "pm.max_children" = 32; + "pm.start_servers" = 2; + "pm.min_spare_servers" = 2; + "pm.max_spare_servers" = 4; + "pm.max_requests" = 500; + }; + description = '' + Options for the Firefly III PHP pool. See the documentation on php-fpm.conf + for details on configuration directives. + ''; + }; + + settings = mkOption { + description = '' + Options for firefly-iii configuration. Refer to + for + details on supported values. All