enable git server on vps

This commit is contained in:
Yan Lin 2026-02-17 21:29:32 +01:00
parent d5376704ca
commit fce7a00b05
6 changed files with 42 additions and 5 deletions

View file

@ -24,7 +24,7 @@
settings = {
user = {
name = "Yan Lin";
email = "github@yanlincs.com";
email = "git@yanlincs.com";
};
credential = {

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;
};