Add gitea

This commit is contained in:
Tim Schubert 2021-01-02 12:42:01 +01:00
parent 359c18bb5d
commit 0a7fa02ecd
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
4 changed files with 36 additions and 0 deletions

33
modules/gitea.nix Normal file
View file

@ -0,0 +1,33 @@
{ config, pkgs, lib, ... }:
let
cfg = config.dadada.gitea;
in {
options.dadada.gitea = {
enable = lib.mkEnableOption "Enable gitea";
};
config = lib.mkIf cfg.enable {
services.gitea = {
enable = true;
appName = "dadada Gitea";
rootUrl = "https://git.dadada.li/";
log.level = "Error";
domain = config.networking.domain;
ssh.enable = true;
cookieSecure = true;
enableUnixSocket = true;
database = {
type = "postgres";
};
disableRegistration = true;
};
services.nginx.virtualHosts."git.${config.networking.domain}" = {
enableACME = true;
forceSSL = true;
locations."/".extraConfig = ''
proxy_pass unix:/run/gitea/gitea.sock;
'';
};
};
}