add forgejo
This commit is contained in:
parent
6a3e77e142
commit
c2112ea153
49
git.nix
Normal file
49
git.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
domain = "git.kamoshi.org";
|
||||||
|
user = "forgejo";
|
||||||
|
state = "/var/lib/forgejo";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
users = {
|
||||||
|
users.${user} = {
|
||||||
|
description = "Forgejo Service";
|
||||||
|
home = state;
|
||||||
|
group = user;
|
||||||
|
useDefaultShell = true;
|
||||||
|
isSystemUser = true;
|
||||||
|
};
|
||||||
|
groups.${user} = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
|
forgejo = {
|
||||||
|
enable = true;
|
||||||
|
user = user;
|
||||||
|
group = user;
|
||||||
|
stateDir = state;
|
||||||
|
# https://forgejo.org/docs/latest/admin/config-cheat-sheet/
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
HTTP_PORT = 3200;
|
||||||
|
HTTP_ADDR = "127.0.0.1";
|
||||||
|
DOMAIN = domain;
|
||||||
|
ROOT_URL = "https://${domain}/";
|
||||||
|
LANDING_PAGE = "explore";
|
||||||
|
};
|
||||||
|
|
||||||
|
service = {
|
||||||
|
DISABLE_REGISTRATION = lib.mkForce true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nginx.virtualHosts.${domain} = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:3200/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
18
web.nix
18
web.nix
|
@ -23,12 +23,18 @@
|
||||||
recommendedGzipSettings = true;
|
recommendedGzipSettings = true;
|
||||||
recommendedOptimisation = true;
|
recommendedOptimisation = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
virtualHosts = {
|
|
||||||
"kamoshi.org" = {
|
virtualHosts."kamoshi.org" = {
|
||||||
root = "/var/www/kamoshi.org";
|
root = "/var/www/kamoshi.org";
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
};
|
|
||||||
|
listen = [
|
||||||
|
{ addr = "[::]"; port = 80; ssl = false; }
|
||||||
|
{ addr = "0.0.0.0"; port = 80; ssl = false; }
|
||||||
|
{ addr = "[::]"; port = 443; ssl = true; }
|
||||||
|
{ addr = "0.0.0.0"; port = 443; ssl = true; }
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue