nixos-config/machines/orbi/service-vikunja.nix
2024-08-08 16:39:50 +02:00

62 lines
1.4 KiB
Nix

{ config, pkgs, lib, components, ... }:
let
vikunjaPort = 3456;
mysqlPort = 3337;
in
{
networking.firewall.interfaces.wg0.allowedTCPPorts = [ vikunjaPort ];
containers.vikunja = {
privateNetwork = false;
autoStart = true;
config = { config, lib, ... }: {
nixpkgs.pkgs = pkgs;
imports = [ "${components}/monitor/container.nix" ];
system.stateVersion = "24.05";
services.logrotate.checkConfig = false; # because uid 3000 does not exist in here
# Vikunja
# ----------
services.vikunja = {
enable = true;
port = vikunjaPort;
frontendScheme = "http";
frontendHostname = "vikunja.ingolf-wagner.de";
database.type = "sqlite";
#database = {
# type = "mysql";
# host = "localhost:${toString mysqlPort}";
# user = "vikunja";
#};
};
# MySQL Database
# --------------
services.mysql = {
enable = false;
package = pkgs.mariadb;
settings.mysqld.port = mysqlPort;
ensureDatabases = [ "vikunja" ];
ensureUsers = [{
name = "vikunja";
ensurePermissions = {
"vikunja.*" = "ALL PRIVILEGES";
};
}];
};
# Backup Database
# ---------------
services.mysqlBackup = {
enable = false;
databases = config.services.mysql.ensureDatabases;
singleTransaction = true;
};
};
};
}