services: add gitea
This commit is contained in:
parent
5d41f6206d
commit
b4b62b5bc6
|
@ -69,6 +69,8 @@
|
|||
|
||||
# List services that you want to enable:
|
||||
my.services = {
|
||||
# Gitea forge
|
||||
gitea.enable = true;
|
||||
# Matrix backend and Element chat front-end
|
||||
matrix.enable = true;
|
||||
};
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./gitea.nix
|
||||
./matrix.nix
|
||||
./nginx.nix
|
||||
];
|
||||
|
|
43
services/gitea.nix
Normal file
43
services/gitea.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
# A low-ressource, full-featured git forge.
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.gitea;
|
||||
domain = config.networking.domain;
|
||||
giteaDomain = "gitea.${config.networking.domain}";
|
||||
in
|
||||
{
|
||||
options.my.services.gitea = {
|
||||
enable = lib.mkEnableOption "Gitea";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
appName = "Ambroisie's Gitea";
|
||||
domain = "${giteaDomain}";
|
||||
rootUrl = "https://${giteaDomain}";
|
||||
useWizard = true;
|
||||
disableRegistration = true;
|
||||
lfs.enable = true;
|
||||
};
|
||||
|
||||
# Enable DB
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
authentication = ''
|
||||
local gitea all ident map=gitea-users
|
||||
'';
|
||||
identMap = '' # Map the gitea user to postgresql
|
||||
gitea-users gitea gitea
|
||||
'';
|
||||
};
|
||||
|
||||
# Proxy to Gitea
|
||||
services.nginx.virtualHosts."${giteaDomain}" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "${domain}";
|
||||
|
||||
locations."/".proxyPass = "http://localhost:3000/";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue