nixos-config/machines/orbi/service-vikunja.nix

76 lines
1.6 KiB
Nix
Raw Normal View History

2024-08-29 03:26:04 +02:00
{
config,
pkgs,
lib,
components,
2024-08-31 18:28:34 +02:00
inputs,
2024-08-29 03:26:04 +02:00
...
}:
2024-06-22 19:31:50 +02:00
let
vikunjaPort = 3456;
mysqlPort = 3337;
in
{
networking.firewall.interfaces.wg0.allowedTCPPorts = [ vikunjaPort ];
containers.vikunja = {
privateNetwork = false;
autoStart = true;
2024-08-29 03:26:04 +02:00
config =
{ config, lib, ... }:
{
nixpkgs.pkgs = pkgs;
2024-08-31 18:28:34 +02:00
imports = [
"${components}/monitor/container.nix"
inputs.nix-topology.nixosModules.default
];
2024-08-29 03:26:04 +02:00
system.stateVersion = "24.05";
services.logrotate.checkConfig = false; # because uid 3000 does not exist in here
2024-06-22 19:31:50 +02:00
2024-08-29 03:26:04 +02:00
# 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";
#};
};
2024-06-22 19:31:50 +02:00
2024-08-29 03:26:04 +02:00
# MySQL Database
# --------------
services.mysql = {
enable = false;
package = pkgs.mariadb;
settings.mysqld.port = mysqlPort;
ensureDatabases = [ "vikunja" ];
ensureUsers = [
{
name = "vikunja";
ensurePermissions = {
"vikunja.*" = "ALL PRIVILEGES";
};
}
];
};
2024-06-22 19:31:50 +02:00
2024-08-29 03:26:04 +02:00
# Backup Database
# ---------------
services.mysqlBackup = {
enable = false;
databases = config.services.mysql.ensureDatabases;
singleTransaction = true;
};
2024-06-22 19:31:50 +02:00
2024-08-29 03:26:04 +02:00
};
};
2024-06-22 19:31:50 +02:00
}