gitea: nix formatting

This commit is contained in:
Serĉanto de Scio 2022-05-05 14:48:46 +10:00
parent b6defaf038
commit 014275233f
Signed by: sercanto
GPG key ID: 7DBA9F5689EFB6AA

View file

@ -1,9 +1,10 @@
# NixOps configuration for the hosts running Gitea # NixOps configuration for the hosts running Gitea
{ config, pkgs, lib, ... }:
{ {
config,
pkgs,
lib,
...
}: {
services.gitea = { services.gitea = {
enable = true; # Enable Gitea enable = true; # Enable Gitea
appName = "mcwhirter.io: Gitea Service"; # Give the site a name appName = "mcwhirter.io: Gitea Service"; # Give the site a name
@ -26,8 +27,8 @@
ENABLED = true; ENABLED = true;
FROM = "gitea@mcwhirter.io"; FROM = "gitea@mcwhirter.io";
}; };
repository = { DEFAULT_BRANCH = "consensus"; }; repository = {DEFAULT_BRANCH = "consensus";};
service = { REGISTER_EMAIL_CONFIRM = true; }; service = {REGISTER_EMAIL_CONFIRM = true;};
"markup.restructuredtext" = { "markup.restructuredtext" = {
ENABLED = true; ENABLED = true;
FILE_EXTENSIONS = ".rst"; FILE_EXTENSIONS = ".rst";
@ -45,18 +46,22 @@
authentication = '' authentication = ''
local gitea all ident map=gitea-users local gitea all ident map=gitea-users
''; '';
identMap = # Map the gitea user to postgresql identMap =
# Map the gitea user to postgresql
'' ''
gitea-users gitea gitea gitea-users gitea gitea
''; '';
ensureDatabases = [ "gitea" ]; # Ensure the database persists ensureDatabases = ["gitea"]; # Ensure the database persists
ensureUsers = [{ ensureUsers = [
name = "gitea"; # Ensure the database user persists {
ensurePermissions = { # Ensure the database permissions persist name = "gitea"; # Ensure the database user persists
"DATABASE gitea" = "ALL PRIVILEGES"; ensurePermissions = {
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES"; # Ensure the database permissions persist
}; "DATABASE gitea" = "ALL PRIVILEGES";
}]; "ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
};
}
];
}; };
services.nginx = { services.nginx = {
@ -65,18 +70,21 @@
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
virtualHosts."source.mcwhirter.io" = { # Gitea hostname virtualHosts."source.mcwhirter.io" = {
# Gitea hostname
enableACME = true; # Use ACME certs enableACME = true; # Use ACME certs
forceSSL = true; # Force SSL forceSSL = true; # Force SSL
locations."/".proxyPass = "http://localhost:3002/"; # Proxy Gitea locations."/".proxyPass = "http://localhost:3002/"; # Proxy Gitea
}; };
virtualHosts."git.mcwhirter.io" = { # Hostname to be redirected virtualHosts."git.mcwhirter.io" = {
# Hostname to be redirected
enableACME = true; # Use ACME certs enableACME = true; # Use ACME certs
forceSSL = true; # Force SSL forceSSL = true; # Force SSL
locations."/".proxyPass = "http://localhost:3002/"; # Proxy Gitea locations."/".proxyPass = "http://localhost:3002/"; # Proxy Gitea
globalRedirect = "source.mcwhirter.io"; # Redirect permanently to the host globalRedirect = "source.mcwhirter.io"; # Redirect permanently to the host
}; };
virtualHosts."code.mcwhirter.io" = { # Hostname to be redirected virtualHosts."code.mcwhirter.io" = {
# Hostname to be redirected
enableACME = true; # Use ACME certs enableACME = true; # Use ACME certs
forceSSL = true; # Force SSL forceSSL = true; # Force SSL
locations."/".proxyPass = "http://localhost:3002/"; # Proxy Gitea locations."/".proxyPass = "http://localhost:3002/"; # Proxy Gitea
@ -93,6 +101,5 @@
}; };
}; };
users.groups.keys.members = [ "gitea" ]; # Required due to NixOps issue #1204 users.groups.keys.members = ["gitea"]; # Required due to NixOps issue #1204
} }