This commit is contained in:
xinyangli 2024-07-30 11:31:27 +08:00
parent 2d995896c2
commit 62fe085b31
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
3 changed files with 8 additions and 8 deletions

View file

@ -44,8 +44,8 @@ in
}; };
}; };
}; };
config = { config = mkIf cfg.enable {
services.hedgedoc = mkIf cfg.enable { services.hedgedoc = {
enable = true; enable = true;
environmentFile = cfg.environmentFile; environmentFile = cfg.environmentFile;
settings = { settings = {
@ -71,13 +71,13 @@ in
defaultPermission = "private"; defaultPermission = "private";
}; };
}; };
services.caddy = mkIf ( cfg.enable && cfg.enable ) { services.caddy = mkIf cfg.caddy {
enable = true; enable = true;
virtualHosts."https://${cfg.domain}".extraConfig = '' virtualHosts."https://${cfg.domain}".extraConfig = ''
reverse_proxy unix/${config.services.hedgedoc.settings.path} reverse_proxy unix/${config.services.hedgedoc.settings.path}
''; '';
}; };
users.users.caddy.extraGroups = mkIf ( cfg.enable && cfg.enable ) [ "hedgedoc" ]; users.users.caddy.extraGroups = mkIf cfg.caddy [ "hedgedoc" ];
}; };
} }

View file

@ -25,7 +25,7 @@ in
}; };
}; };
config = mkMerge [{ config = mkIf cfg.enable (mkMerge [{
services.caddy.globalConfig = '' services.caddy.globalConfig = ''
servers { servers {
metrics metrics
@ -91,5 +91,5 @@ in
}) })
]; ];
} }
]; ]);
} }

View file

@ -16,8 +16,8 @@ in
}; };
}; };
}; };
config = { config = lib.mkIf cfg.enable {
services.restic.backups = lib.mkIf cfg.enable { services.restic.backups = {
remotebackup = { remotebackup = {
repositoryFile = cfg.repositoryFile; repositoryFile = cfg.repositoryFile;
passwordFile = cfg.passwordFile; passwordFile = cfg.passwordFile;