enable forgejo on vps

This commit is contained in:
Yan Lin 2026-02-17 20:51:20 +01:00
parent d5376704ca
commit fa04def7a1
4 changed files with 38 additions and 1 deletions

View file

@ -1,4 +1,7 @@
{ config, lib, ... }:
# NOTE: After install, use the following command to create admin account.
# sudo -u forgejo forgejo --config /var/lib/forgejo/custom/conf/app.ini admin user create --admin --username <user> --password <pass> --email <email>
{ config, lib, pkgs, ... }:
let
cfg = config.services.git-server-custom;
@ -24,6 +27,8 @@ in
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ config.services.forgejo.package ];
services.forgejo = {
enable = true;
lfs.enable = true;
@ -35,6 +40,7 @@ in
HTTP_ADDR = "127.0.0.1";
HTTP_PORT = cfg.httpPort;
SSH_PORT = cfg.sshPort;
LANDING_PAGE = "/yanlin";
};
service.DISABLE_REGISTRATION = true;
};