2020-04-03 17:34:13 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
|
|
|
|
errorPages = pkgs.fetchgit {
|
|
|
|
url = "https://git.ingolf-wagner.de/palo/http-errors.git";
|
|
|
|
rev = "74b8e4c1d9bbba3db6ad858b888e1867318af1f0";
|
|
|
|
sha256 = "0czdzafx4k76q773lyf3vsjm74g1995iz542dhw15kpy5xbivsrg";
|
|
|
|
};
|
|
|
|
|
|
|
|
error = {
|
|
|
|
extraConfig = ''
|
|
|
|
error_page 400 /errors/400.html;
|
|
|
|
error_page 401 /errors/401.html;
|
|
|
|
error_page 402 /errors/402.html;
|
|
|
|
error_page 403 /errors/403.html;
|
|
|
|
error_page 404 /errors/404.html;
|
|
|
|
error_page 405 /errors/405.html;
|
|
|
|
error_page 406 /errors/406.html;
|
|
|
|
error_page 500 /errors/500.html;
|
|
|
|
error_page 501 /errors/501.html;
|
|
|
|
error_page 502 /errors/502.html;
|
|
|
|
error_page 503 /errors/503.html;
|
|
|
|
error_page 504 /errors/504.html;
|
|
|
|
'';
|
|
|
|
locations."^~ /errors/" = {
|
|
|
|
extraConfig = "internal;";
|
|
|
|
root = "${errorPages}/";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-09 16:51:39 +02:00
|
|
|
in {
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
statusPage = true;
|
|
|
|
virtualHosts = {
|
2020-04-03 16:52:53 +02:00
|
|
|
"git.${config.networking.hostName}.private" = {
|
2020-04-03 17:34:13 +02:00
|
|
|
extraConfig = error.extraConfig;
|
2019-10-24 02:20:38 +02:00
|
|
|
locations."/" = {
|
2019-12-20 05:54:26 +01:00
|
|
|
proxyPass = "http://${config.networking.hostName}.private:${
|
|
|
|
toString config.services.gogs.httpPort
|
|
|
|
}";
|
2019-10-24 02:20:38 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.gogs = {
|
|
|
|
enable = true;
|
|
|
|
appName = "Kruck GoGs";
|
|
|
|
domain = "git.ingolf-wagner.de";
|
|
|
|
httpPort = 3000;
|
|
|
|
repositoryRoot = "/home/gogs/repositories";
|
|
|
|
stateDir = "/home/gogs";
|
|
|
|
rootUrl = "https://git.ingolf-wagner.de/";
|
|
|
|
extraConfig = ''
|
|
|
|
[service]
|
|
|
|
DISABLE_REGISTRATION = true
|
|
|
|
SHOW_REGISTRATION_BUTTON = false
|
|
|
|
[server]
|
|
|
|
SSH_DOMAIN = "git.ingolf-wagner.de"
|
|
|
|
SSH_PORT = 443
|
|
|
|
START_SSH_SERVER = true
|
|
|
|
SSH_LISTEN_PORT = 2222
|
2020-04-02 08:53:51 +02:00
|
|
|
|
2020-04-03 16:52:53 +02:00
|
|
|
[log.file]
|
|
|
|
LEVEL = Warn
|
|
|
|
|
|
|
|
[log.console]
|
|
|
|
LEVEL = Warn
|
|
|
|
|
|
|
|
[log.sublogger.macaron]
|
2020-04-02 08:53:51 +02:00
|
|
|
LEVEL = Warn
|
2019-12-20 05:54:26 +01:00
|
|
|
'';
|
2019-10-24 02:20:38 +02:00
|
|
|
};
|
2020-09-04 00:49:35 +02:00
|
|
|
backup.dirs = [ config.services.gogs.repositoryRoot ];
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2020-04-03 16:52:53 +02:00
|
|
|
#services.gitea = {
|
|
|
|
# enable = true;
|
|
|
|
# appName = "Git";
|
|
|
|
# domain = "git.ingolf-wagner.de";
|
|
|
|
# httpPort = 3000;
|
|
|
|
# repositoryRoot = "/home/gitea/repositories";
|
|
|
|
# stateDir = "/home/gitea";
|
|
|
|
# rootUrl = "https://git.ingolf-wagner.de/";
|
|
|
|
# extraConfig = ''
|
|
|
|
# [service]
|
|
|
|
# DISABLE_REGISTRATION = true
|
|
|
|
# SHOW_REGISTRATION_BUTTON = false
|
|
|
|
# [server]
|
|
|
|
# SSH_DOMAIN = "git.ingolf-wagner.de"
|
|
|
|
# SSH_PORT = 443
|
|
|
|
# START_SSH_SERVER = true
|
|
|
|
# SSH_LISTEN_PORT = 2222
|
|
|
|
|
|
|
|
# [log]
|
|
|
|
# LEVEL = Warn
|
|
|
|
# [log.sublogger.macaron]
|
|
|
|
# LEVEL = Warn
|
|
|
|
# '';
|
|
|
|
#};
|
2020-09-04 00:49:35 +02:00
|
|
|
#backup.dirs = [ config.services.gitea.repositoryRoot ];
|
2020-04-03 16:52:53 +02:00
|
|
|
|
2019-10-24 02:20:38 +02:00
|
|
|
}
|