46 lines
1.1 KiB
Nix
46 lines
1.1 KiB
Nix
{ config, pkgs, ... }:
|
|
{
|
|
users.extraUsers.git = { home = config.services.gogs.stateDir; extraGroups = [ "git" ]; };
|
|
users.extraGroups.git = { };
|
|
|
|
services.gogs = rec {
|
|
enable = true;
|
|
stateDir = "/srv/git.gebner.org";
|
|
user = "git";
|
|
group = "git";
|
|
appName = "Gabriel Ebner's git server";
|
|
domain = "git.gebner.org";
|
|
rootUrl = "https://git.gebner.org/";
|
|
httpPort = 8001;
|
|
cookieSecure = true;
|
|
extraConfig = ''
|
|
[picture]
|
|
DISABLE_GRAVATAR = false
|
|
AVATAR_UPLOAD_PATH = ${stateDir}/data/avatars
|
|
|
|
[log]
|
|
ROOT_PATH = ${stateDir}/logs
|
|
MODE = file
|
|
LEVEL = Info
|
|
|
|
[service]
|
|
DISABLE_REGISTRATION = true
|
|
'';
|
|
};
|
|
|
|
services.nginx = {
|
|
recommendedProxySettings = true;
|
|
virtualHosts."git.gebner.org" = {
|
|
forceSSL = true;
|
|
useACMEHost = "gebner.org";
|
|
locations."/" = {
|
|
proxyPass = "http://127.0.0.1:${toString config.services.gogs.httpPort}";
|
|
extraConfig = ''
|
|
proxy_buffering off;
|
|
client_max_body_size 30M;
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|