refactor forgejo to its own file including nginx config
This commit is contained in:
parent
1da3624a02
commit
53a94c2e61
2 changed files with 38 additions and 29 deletions
|
|
@ -8,6 +8,7 @@
|
|||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./forgejo.nix
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
|
|
@ -52,17 +53,6 @@
|
|||
Defaults timestamp_timeout=120
|
||||
'';
|
||||
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
ROOT_URL = "https://git.${domainName}/";
|
||||
PROTOCOL = "http";
|
||||
DOMAIN = "git.${domainName}";
|
||||
};
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.logind.settings.Login = {
|
||||
HandleLidSwitch = "ignore";
|
||||
|
|
@ -144,24 +134,6 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
"git.${domainName}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = ''
|
||||
client_max_body_size 512M;
|
||||
'';
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://localhost:3000";
|
||||
extraConfig = ''
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
security.acme = {
|
||||
|
|
|
|||
37
forgejo.nix
Normal file
37
forgejo.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
domainName,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services = {
|
||||
forgejo = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
ROOT_URL = "https://git.${domainName}/";
|
||||
PROTOCOL = "http";
|
||||
DOMAIN = "git.${domainName}";
|
||||
};
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
nginx.virtualHosts."git.${domainName}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = ''
|
||||
client_max_body_size 512M;
|
||||
'';
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://localhost:3000";
|
||||
extraConfig = ''
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue