From e246dfa3bc75975b7b4344908f9015122b9ed431 Mon Sep 17 00:00:00 2001 From: Christoph Schmatzler Date: Wed, 17 Dec 2025 16:17:36 +0000 Subject: [PATCH] litestream 2 --- profiles/gitea.nix | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/profiles/gitea.nix b/profiles/gitea.nix index 9942908..ec54f18 100644 --- a/profiles/gitea.nix +++ b/profiles/gitea.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +{...}: { networking.firewall.allowedTCPPorts = [80 443]; services.gitea = { @@ -25,32 +25,11 @@ }; }; - users.users.litestream.extraGroups = ["gitea"]; - - systemd.services.gitea.serviceConfig.ExecStartPost = - "+" - + pkgs.writeShellScript "grant-gitea-permissions" '' - timeout=10 - - while [ ! -f /var/lib/gitea/data/gitea.db ]; - do - if [ "$timeout" == 0 ]; then - echo "ERROR: Timeout while waiting for /var/lib/gitea/data/gitea.db." - exit 1 - fi - - sleep 1 - - ((timeout--)) - done - - find /var/lib/gitea -type d -exec chmod -v 775 {} \; - find /var/lib/gitea -type f -exec chmod -v 660 {} \; - ''; - services.litestream = { enable = true; environmentFile = "/run/secrets/litestream"; + user = "gitea"; + group = "gitea"; settings = { dbs = [ {