nixos-config/hosts/chunk/forgejo.nix

50 lines
1.2 KiB
Nix
Raw Permalink Normal View History

{ pkgs, ... }:
2025-01-10 01:27:05 -05:00
{
services.forgejo = {
enable = true;
package = pkgs.forgejo; # uses forgejo-lts by default
2025-01-10 01:27:05 -05:00
user = "git";
group = "git";
settings = {
server = {
ROOT_URL = "https://git.cy7.sh";
HTTP_PORT = 3000;
HTTP_ADDR = "127.0.0.1";
DOMAIN = "git.cy7.sh";
LANDING_PAGE = "explore";
2025-01-10 01:27:05 -05:00
};
session.COOKIE_SECURE = true;
service.DISABLE_REGISTRATION = true;
ui = {
AMBIGUOUS_UNICODE_DETECTION = false;
DEFAULT_THEME = "forgejo-dark";
2025-01-10 01:27:05 -05:00
};
2025-01-10 01:43:19 -05:00
actions.ENABLED = false;
2025-01-10 21:43:00 -05:00
repository.ENABLE_PUSH_CREATE_USER = true;
2025-01-20 01:48:04 -05:00
indexer.REPO_INDEXER_ENABLED = true;
2025-01-10 01:27:05 -05:00
};
database = {
type = "postgres";
socket = "/run/postgresql";
user = "git";
name = "git";
};
};
services.caddy.virtualHosts."git.cy7.sh".extraConfig = ''
import common
reverse_proxy localhost:3000
'';
services.caddy.virtualHosts."git.cything.io".extraConfig = ''
import common
# wrap in route so things are evaluated in the order written
route {
# rewrite gitlab URIs to make it work with forgejo
uri path_regexp /-/ /
uri replace /blob/ /src/
redir https://git.cy7.sh{uri} permanent
}
'';
2025-01-10 01:27:05 -05:00
}