collabora + posgres.enable check

This commit is contained in:
Danilo Reyes 2024-06-15 00:54:22 -06:00
parent e726ebedc1
commit b66baa6c19
5 changed files with 91 additions and 86 deletions

View File

@ -37,7 +37,7 @@
adguardhome.enable = false;
audiobookshelf.enable = false;
bazarr.enable = false;
collabora.enable = false;
collabora.enable = true;
flame.enable = true;
flameSecret.enable = true;
go-vod.enable = false;

View File

@ -1,28 +1,29 @@
{ lib, config, ... }: {
options.my.servers.paperless.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.servers.paperless.enable {
services.paperless = {
enable = true;
address = "0.0.0.0";
consumptionDirIsPublic = true;
consumptionDir = "/mnt/pool/scans/";
settings = {
PAPERLESS_DBENGINE = "postgress";
PAPERLESS_DBNAME = "paperless";
PAPERLESS_DBHOST = config.my.postgresSocket;
PAPERLESS_CONSUMER_IGNORE_PATTERN =
builtins.toJSON [ ".DS_STORE/*" "desktop.ini" ];
PAPERLESS_TIME_ZONE = "America/Mexico_City";
PAPERLESS_OCR_USER_ARGS = builtins.toJSON {
optimize = 1;
pdfa_image_compression = "lossless";
config = lib.mkIf
(config.my.servers.paperless.enable && config.my.servers.postgres.enable) {
services.paperless = {
enable = true;
address = "0.0.0.0";
consumptionDirIsPublic = true;
consumptionDir = "/mnt/pool/scans/";
settings = {
PAPERLESS_DBENGINE = "postgress";
PAPERLESS_DBNAME = "paperless";
PAPERLESS_DBHOST = config.my.postgresSocket;
PAPERLESS_CONSUMER_IGNORE_PATTERN =
builtins.toJSON [ ".DS_STORE/*" "desktop.ini" ];
PAPERLESS_TIME_ZONE = "America/Mexico_City";
PAPERLESS_OCR_USER_ARGS = builtins.toJSON {
optimize = 1;
pdfa_image_compression = "lossless";
};
};
};
networking.firewall = {
enable = true;
allowedTCPPorts = [ config.services.paperless.port ];
allowedUDPPorts = [ config.services.paperless.port ];
};
};
networking.firewall = {
enable = true;
allowedTCPPorts = [ config.services.paperless.port ];
allowedUDPPorts = [ config.services.paperless.port ];
};
};
}

View File

@ -4,31 +4,33 @@ let
url = "tracker.${config.my.domain}";
in {
options.my.servers.ryot.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.servers.ryot.enable {
virtualisation.oci-containers = {
backend = "docker";
containers.ryot = {
image = "ghcr.io/ignisda/ryot:v5.5.0";
ports = [ "8765:8000" ];
environment = {
TZ = "America/Mexico_City";
DATABASE_URL = "postgres:///ryot?host=${config.my.postgresSocket}";
FRONTEND_INSECURE_COOKIES = "true";
VIDEO_GAMES_TWITCH_CLIENT_ID = "tfu0hw0zbdbu4lco4h72nqkb8krxp9";
VIDEO_GAMES_TWITCH_CLIENT_SECRET = "582ecfb01ihv6wnt8zbc9pf3hs9p54";
};
volumes = [ "${config.my.postgresSocket}:${config.my.postgresSocket}" ];
labels = {
"flame.type" = "application";
"flame.name" = "Ryot";
"flame.url" = url;
"flame.icon" = "radar";
config = lib.mkIf
(config.my.servers.ryot.enable && config.my.servers.postgres.enable) {
virtualisation.oci-containers = {
backend = "docker";
containers.ryot = {
image = "ghcr.io/ignisda/ryot:v5.5.0";
ports = [ "8765:8000" ];
environment = {
TZ = "America/Mexico_City";
DATABASE_URL = "postgres:///ryot?host=${config.my.postgresSocket}";
FRONTEND_INSECURE_COOKIES = "true";
VIDEO_GAMES_TWITCH_CLIENT_ID = "tfu0hw0zbdbu4lco4h72nqkb8krxp9";
VIDEO_GAMES_TWITCH_CLIENT_SECRET = "582ecfb01ihv6wnt8zbc9pf3hs9p54";
};
volumes =
[ "${config.my.postgresSocket}:${config.my.postgresSocket}" ];
labels = {
"flame.type" = "application";
"flame.name" = "Ryot";
"flame.url" = url;
"flame.icon" = "radar";
};
};
};
services.nginx = {
enable = true;
virtualHosts."tracker.${config.my.domain}" = proxyReverse port // { };
};
};
services.nginx = {
enable = true;
virtualHosts."tracker.${config.my.domain}" = proxyReverse port // { };
};
};
}

View File

@ -2,20 +2,21 @@
disabledModules = [ "services/web-apps/shiori.nix" ];
imports = [ ../../pkgs/shiori/shiori-service.nix ];
options.my.servers.shiori.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.servers.shiori.enable {
services = {
shiori = {
enable = true;
port = 4368;
package = pkgs.callPackage ../../pkgs/shiori/shiori.nix { };
httpSecretKey = "password";
databaseUrl = "postgres:///shiori?host=${config.my.postgresSocket}";
};
nginx = {
enable = true;
virtualHosts."bookmarks.${config.my.domain}" =
proxyReverse config.services.shiori.port // { };
config = lib.mkIf
(config.my.servers.shiori.enable && config.my.servers.postgres.enable) {
services = {
shiori = {
enable = true;
port = 4368;
package = pkgs.callPackage ../../pkgs/shiori/shiori.nix { };
httpSecretKey = "password";
databaseUrl = "postgres:///shiori?host=${config.my.postgresSocket}";
};
nginx = {
enable = true;
virtualHosts."bookmarks.${config.my.domain}" =
proxyReverse config.services.shiori.port // { };
};
};
};
};
}

View File

@ -1,31 +1,32 @@
{ lib, config, pkgs, proxyReverse, ... }: {
options.my.servers.vaultwarden.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.servers.vaultwarden.enable {
services = {
vaultwarden = {
enable = true;
dbBackend = "postgresql";
package = pkgs.vaultwarden;
environmentFile = "/var/lib/vaultwarden.env";
config = {
ROCKET_ADDRESS = "${config.my.localhost}";
ROCKET_PORT = 8222;
WEBSOCKET_PORT = 8333;
DATABASE_URL =
"postgresql:///vaultwarden?host=${config.my.postgresSocket}";
ENABLE_DB_WAL = false;
WEBSOCKET_ENABLED = true;
SHOW_PASSWORD_HINT = false;
SIGNUPS_ALLOWED = false;
EXTENDED_LOGGING = true;
LOG_LEVEL = "warn";
config = lib.mkIf (config.my.servers.vaultwarden.enable
&& config.my.servers.postgres.enable) {
services = {
vaultwarden = {
enable = true;
dbBackend = "postgresql";
package = pkgs.vaultwarden;
environmentFile = "/var/lib/vaultwarden.env";
config = {
ROCKET_ADDRESS = "${config.my.localhost}";
ROCKET_PORT = 8222;
WEBSOCKET_PORT = 8333;
DATABASE_URL =
"postgresql:///vaultwarden?host=${config.my.postgresSocket}";
ENABLE_DB_WAL = false;
WEBSOCKET_ENABLED = true;
SHOW_PASSWORD_HINT = false;
SIGNUPS_ALLOWED = false;
EXTENDED_LOGGING = true;
LOG_LEVEL = "warn";
};
};
nginx = {
enable = true;
virtualHosts."vault.${config.my.domain}" =
proxyReverse config.services.vaultwarden.config.ROCKET_PORT // { };
};
};
nginx = {
enable = true;
virtualHosts."vault.${config.my.domain}" =
proxyReverse config.services.vaultwarden.config.ROCKET_PORT // { };
};
};
};
}