commit message
This commit is contained in:
parent
270e1a0be4
commit
77afca4525
57 changed files with 971 additions and 423 deletions
72
modules/server/misc/forgejo.nix
Normal file
72
modules/server/misc/forgejo.nix
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
server.misc.forgejo = {
|
||||
enable = lib.mkEnableOption "enable forgejo";
|
||||
port = lib.mkOption {
|
||||
default = 2934;
|
||||
description = "forgejo port";
|
||||
};
|
||||
public = lib.mkEnableOption "public forgejo";
|
||||
subdomain = lib.mkOption {
|
||||
default = "git";
|
||||
description = "forgejo subdomain";
|
||||
};
|
||||
settings = {
|
||||
app_name = lib.mkOption {
|
||||
default = "${config.user.userName}'s code dump";
|
||||
description = "forgejo app name";
|
||||
};
|
||||
app_slogan = lib.mkOption {
|
||||
default = "if code could talk, mine would cry";
|
||||
description = "forgejo app slogan";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
services = {
|
||||
forgejo = {
|
||||
enable = config.server.misc.forgejo.enable;
|
||||
database.type = "postgres";
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = "${config.server.misc.forgejo.subdomain}.${config.networking.domain}";
|
||||
ROOT_URL = "https://${config.server.misc.forgejo.subdomain}.${config.networking.domain}";
|
||||
HTTP_PORT = config.server.misc.forgejo.port;
|
||||
};
|
||||
DEFAULT = {
|
||||
APP_NAME = config.server.misc.forgejo.settings.app_name;
|
||||
APP_SLOGAN = config.server.misc.forgejo.settings.app_slogan;
|
||||
};
|
||||
REPOSITORY = {
|
||||
ENABLE_PUSH_CREATE_USER = true;
|
||||
ENABLE_PUSH_CREATE_ORG = true;
|
||||
|
||||
};
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
nginx = {
|
||||
virtualHosts = {
|
||||
"${config.server.misc.forgejo.subdomain}.${config.networking.domain}" =
|
||||
if config.server.misc.forgejo.public then
|
||||
{
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.server.misc.forgejo.port}";
|
||||
};
|
||||
}
|
||||
else
|
||||
{ };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue