This commit is contained in:
aloslider committed 2026-10-01 13:59:54 +03:00
1 parent 13e407847f
commit 374428658a
80 files changed
+2517 -1058

No files matched your search

@@ -0,0 +1,25 @@
{ config, lib, ... }:
with lib;
let
rootCfg = config.selfhosted.seafile;
in
{
config = mkIf rootCfg.enable {
sops.templates."seafile-thumbnail.env".content = ''
TIME_ZONE=${config.time.timeZone}
SEAFILE_MYSQL_DB_HOST=${rootCfg.mariadb.name}
SEAFILE_MYSQL_DB_PORT=3306
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWORD=${config.sops.placeholder."seafile/mysql_password"}
SEAFILE_MYSQL_DB_CCNET_DB_NAME=ccnet_db
SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=seafile_db
NON_ROOT=false
JWT_PRIVATE_KEY=${config.sops.placeholder."seafile/jwt_private_key"}
SEAFILE_LOG_TO_STDOUT=false
SITE_ROOT=/
INNER_SEAHUB_SERVICE_URL=http://${rootCfg.server.name}
THUMBNAIL_IMAGE_ORIGINAL_SIZE_LIMIT=256
SEAF_SERVER_STORAGE_TYPE=disk
'';
};
}
@@ -0,0 +1,53 @@
{ config, lib, ... }:
with lib;
let
common = config.selfhosted.common;
rootCfg = config.selfhosted.seafile;
cfg = rootCfg.thumbnail;
hostDataPath = "${common.dataDir}/seafile";
in
{
imports = [ ./config.nix ];
options.selfhosted.seafile.thumbnail = {
name = mkOption {
type = types.str;
};
hostHttpPort = mkOption {
type = types.port;
};
};
config = mkIf rootCfg.enable {
virtualisation.oci-containers.containers.${cfg.name} = {
image = "docker.io/seafileltd/thumbnail-server:13.0.20";
ports = [
"0.0.0.0:${toString cfg.hostHttpPort}:80"
];
environmentFiles = [ config.sops.templates."seafile-thumbnail.env".path ];
volumes = [
"${hostDataPath}/server/shared:/shared"
];
log-driver = "journald";
extraOptions = [
"--network=${common.network.name}"
];
};
systemd.services."${common.backend}-${cfg.name}" = {
serviceConfig = {
Restart = lib.mkOverride 90 "always";
};
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
requires = [
"${common.backend}-${rootCfg.mariadb.name}.service"
"${common.backend}-${rootCfg.server.name}.service"
];
after = [
"${common.backend}-${rootCfg.mariadb.name}.service"
"${common.backend}-${rootCfg.server.name}.service"
];
};
};
}