Files
dev/configs/nixos/guests/gitea.nix
T

49 lines
1.1 KiB
Nix

{
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.";
}
];
registry.homepage.${config.networking.hostName}.gitea = {
tab = "Apps";
section = "Other";
name = "Gitea";
description = "Git forge";
icon = "gitea.png";
};
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";
};
};
};
}