set up a config for forgejo
This commit is contained in:
parent
7f813c2488
commit
62ea03a213
2 changed files with 43 additions and 0 deletions
42
configs/services/forgejo.nix
Normal file
42
configs/services/forgejo.nix
Normal 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 ];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
networking.hostName = "testhost";
|
networking.hostName = "testhost";
|
||||||
imports = [
|
imports = [
|
||||||
./configs/container_config.nix
|
./configs/container_config.nix
|
||||||
|
./configs/services/forgejo.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue