nixos/matomo: allow changing hostname easily

This commit is contained in:
Maciej Krüger 2021-07-07 18:49:44 +02:00
parent 9e70e9f732
commit 769f20e20a
No known key found for this signature in database
GPG Key ID: 0D948CE19CF49C5F

View File

@ -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";