summary refs log tree commit diff
path: root/nixos/modules/services/web-apps/matomo.nix
diff options
context:
space:
mode:
authorMaciej Krüger <mkg20001@gmail.com>2021-07-07 18:49:44 +0200
committerMaciej Krüger <mkg20001@gmail.com>2021-11-09 15:10:01 +0100
commit769f20e20ae047a69e084c105e57d66ba87d0da9 (patch)
tree86ffca52bbbb95551a7f79dcb07e8127d036366d /nixos/modules/services/web-apps/matomo.nix
parent9e70e9f732fbb15872cb4ea11bd43c14328a0b69 (diff)
downloadnixpkgs-769f20e20ae047a69e084c105e57d66ba87d0da9.tar
nixpkgs-769f20e20ae047a69e084c105e57d66ba87d0da9.tar.gz
nixpkgs-769f20e20ae047a69e084c105e57d66ba87d0da9.tar.bz2
nixpkgs-769f20e20ae047a69e084c105e57d66ba87d0da9.tar.lz
nixpkgs-769f20e20ae047a69e084c105e57d66ba87d0da9.tar.xz
nixpkgs-769f20e20ae047a69e084c105e57d66ba87d0da9.tar.zst
nixpkgs-769f20e20ae047a69e084c105e57d66ba87d0da9.zip
nixos/matomo: allow changing hostname easily
Diffstat (limited to 'nixos/modules/services/web-apps/matomo.nix')
-rw-r--r--nixos/modules/services/web-apps/matomo.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/nixos/modules/services/web-apps/matomo.nix b/nixos/modules/services/web-apps/matomo.nix
index b0d281cfb6e..4dd599451ed 100644
--- a/nixos/modules/services/web-apps/matomo.nix
+++ b/nixos/modules/services/web-apps/matomo.nix
@@ -24,6 +24,7 @@ in {
     (mkRemovedOptionModule [ "services" "piwik" "phpfpmProcessManagerConfig" ] "Use services.phpfpm.pools.<name>.settings")
     (mkRemovedOptionModule [ "services" "matomo" "phpfpmProcessManagerConfig" ] "Use services.phpfpm.pools.<name>.settings")
     (mkRenamedOptionModule [ "services" "piwik" "nginx" ] [ "services" "matomo" "nginx" ])
+    (mkRenamedOptionModule [ "services" "matomo" "periodicArchiveProcessingUrl" ] [ "services" "matomo" "hostname" ])
   ];
 
   options = {
@@ -77,7 +78,7 @@ in {
         '';
       };
 
-      periodicArchiveProcessingUrl = mkOption {
+      hostname = mkOption {
         type = types.str;
         default = "${user}.${fqdn}";
         example = "matomo.yourdomain.org";
@@ -202,7 +203,7 @@ in {
         UMask = "0007";
         CPUSchedulingPolicy = "idle";
         IOSchedulingClass = "idle";
-        ExecStart = "${cfg.package}/bin/matomo-console core:archive --url=https://${cfg.periodicArchiveProcessingUrl}";
+        ExecStart = "${cfg.package}/bin/matomo-console core:archive --url=https://${cfg.hostname}";
       };
     };
 
@@ -258,7 +259,7 @@ in {
       # References:
       # https://fralef.me/piwik-hardening-with-nginx-and-php-fpm.html
       # https://github.com/perusio/piwik-nginx
-      "${user}.${fqdn}" = mkMerge [ cfg.nginx {
+      "${cfg.hostname}" = mkMerge [ cfg.nginx {
         # don't allow to override the root easily, as it will almost certainly break Matomo.
         # disadvantage: not shown as default in docs.
         root = mkForce "${cfg.package}/share";