Small modules config restructure
Changed variables names in every module
This commit is contained in:
1 parent
c1d2e52bf8
commit
c92b90e406
83 files changed
+616
-523
No files matched your search
@@ -1,9 +1,10 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
rootCfg = config.selfhosted.seafile;
|
||||
cfg = rootCfg.notification;
|
||||
rootCfg = config.selfhosted;
|
||||
common = rootCfg.common;
|
||||
moduleCfg = rootCfg.seafile;
|
||||
cfg = moduleCfg.notification;
|
||||
hostDataPath = "${common.dataDir}/seafile";
|
||||
in
|
||||
{
|
||||
@@ -18,7 +19,7 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf rootCfg.enable {
|
||||
config = mkIf moduleCfg.enable {
|
||||
virtualisation.oci-containers.containers.${cfg.name} = {
|
||||
image = "docker.io/seafileltd/notification-server:13.0-latest";
|
||||
ports = [
|
||||
@@ -38,21 +39,21 @@ in
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 90 "always";
|
||||
};
|
||||
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
|
||||
wantedBy = [ "${common.backend}-${moduleCfg.targetName}.target" ];
|
||||
partOf = [ "${common.backend}-${moduleCfg.targetName}.target" ];
|
||||
requires = [
|
||||
"${common.backend}-${rootCfg.mariadb.name}.service"
|
||||
"${common.backend}-${rootCfg.server.name}.service"
|
||||
"${common.backend}-${moduleCfg.mariadb.name}.service"
|
||||
"${common.backend}-${moduleCfg.server.name}.service"
|
||||
];
|
||||
after = [
|
||||
"${common.backend}-${rootCfg.mariadb.name}.service"
|
||||
"${common.backend}-${rootCfg.server.name}.service"
|
||||
"${common.backend}-${moduleCfg.mariadb.name}.service"
|
||||
"${common.backend}-${moduleCfg.server.name}.service"
|
||||
];
|
||||
path = with pkgs; [ curl gawk ];
|
||||
preStart = ''
|
||||
echo "Waiting for Seafile server to be ready..."
|
||||
for i in {1..60}; do
|
||||
status=$(curl -sI --max-time 5 "http://localhost:${toString rootCfg.server.hostHttpPort}" | head -1 | awk '{print $2}')
|
||||
status=$(curl -sI --max-time 5 "http://localhost:${toString moduleCfg.server.hostHttpPort}" | head -1 | awk '{print $2}')
|
||||
|
||||
if [[ "$status" =~ ^(200|301|302)$ ]]; then
|
||||
echo "Seafile server is up (HTTP $status, attempt $i)"
|
||||
|
||||
Reference in new issue
Block a user