1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(ful): add matomo and backup

This commit is contained in:
2023-02-16 08:46:18 +01:00
parent d0eb69229d
commit 0698624eb8
2 changed files with 57 additions and 1 deletions

View File

@@ -4,10 +4,11 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (import <niveum/lib>) kieran retiolumAddresses; inherit (import <niveum/lib>) kieran retiolumAddresses restic;
in { in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./matomo.nix
<niveum/configs/monitoring.nix> <niveum/configs/monitoring.nix>
<niveum/configs/nix.nix> <niveum/configs/nix.nix>
<niveum/configs/save-space.nix> <niveum/configs/save-space.nix>
@@ -16,6 +17,19 @@ in {
<niveum/configs/retiolum.nix> <niveum/configs/retiolum.nix>
]; ];
services.restic.backups.niveum = {
initialize = true;
inherit (restic) repository;
timerConfig = {
OnCalendar = "daily";
RandomizedDelaySec = "1h";
};
passwordFile = toString <secrets/restic/password>;
paths = [
config.services.mysqlBackup.location
];
};
nix.nixPath = ["/var/src"]; nix.nixPath = ["/var/src"];
networking = { networking = {

42
systems/ful/matomo.nix Normal file
View File

@@ -0,0 +1,42 @@
{pkgs, ...}: let
inherit (import <niveum/lib>) kieran;
in {
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
};
security.acme = {
acceptTerms = true;
defaults.email = kieran.email;
};
services.matomo = {
enable = true;
hostname = "matomo.kmein.de";
nginx = {
serverName = "matomo.kmein.de";
};
};
services.mysql = {
enable = true;
package = pkgs.mariadb;
ensureDatabases = ["matomo"];
ensureUsers = [
{
name = "matomo";
ensurePermissions."matomo.*" = "ALL PRIVILEGES";
}
];
};
services.mysqlBackup = {
enable = true;
databases = ["matomo"];
};
}