set up a config for forgejo

This commit is contained in:
Clara Dautermann 2025-03-14 13:31:59 +01:00
parent 7f813c2488
commit 62ea03a213
2 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,42 @@
{ lib, pkgs, config, ... }:
let
dbname = "forgejo";
ssh_port = 2000;
in
{
# enable and configure forgejo
services.forgejo = {
enable = true;
database = {
type = "postgres";
name = dbname;
};
settings = {
server = {
DOMAIN = "192.168.178.50";
SSH_PORT = ssh_port;
# important because otherwise ssh doesn't seem to work…
START_SSH_SERVER = true;
BUILTIN_SSH_SERVER_USER = "git";
};
cache = {
ADAPTER = "twoqueue";
HOST = "{\"size\":100, \"recent_ratio\":0.25, \"ghost_ratio\":0.5}";
};
service.DISABLE_REGISTRATION = true;
repository.USE_COMPAT_SSH_URI = true;
security.LOGIN_REMEMBER_DAYS = 365;
};
};
# enable a PostgreSQL DB for forgejo
services.postgresql = {
enable = true;
ensureDatabases = [ dbname ];
};
networking.firewall.allowedTCPPorts = [ 3000 ssh_port ];
}

View file

@ -19,6 +19,7 @@
networking.hostName = "testhost"; networking.hostName = "testhost";
imports = [ imports = [
./configs/container_config.nix ./configs/container_config.nix
./configs/services/forgejo.nix
]; ];
}; };
}; };