nixos-config/machines/orbi/service-vikunja.nix
2024-09-30 20:48:04 +09:00

76 lines
1.7 KiB
Nix

{
config,
pkgs,
lib,
components,
inputs,
...
}:
let
vikunjaPort = 3456;
mysqlPort = 3337;
in
{
networking.firewall.interfaces.wg0.allowedTCPPorts = [ vikunjaPort ];
healthchecks.closed.public.ports.vikunja = [ vikunjaPort ];
containers.vikunja = {
privateNetwork = false;
autoStart = true;
config =
{ config, lib, ... }:
{
nixpkgs.pkgs = pkgs;
imports = [
"${components}/monitor/container.nix"
inputs.nix-topology.nixosModules.default
];
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;
};
};
};
}