{ config, lib, registry, ... }: let cfg = config.guests.gitea; in { options.guests.gitea.dataPath = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; example = "/srv/gitea"; description = "Host path mounted as Gitea's state directory."; }; config = lib.mkIf cfg.enable { assertions = [ { assertion = cfg.dataPath != null; message = "guests.gitea.dataPath must point at the host directory that stores Gitea state."; } ]; guests.gitea = { interior.modules.services.gitea = { enable = true; reverseProxyAddress = registry.address.${config.networking.hostName}."reverse-proxy"; }; mounts."/var/lib/gitea" = { directory = cfg.dataPath; owner = config.registry."stable-uid".${config.networking.hostName}.gitea; group = "storage"; mode = "2770"; }; }; }; }