Add a module for gitea

This commit is contained in:
Andreas Zweili 2022-11-03 15:24:37 +01:00
parent 5d290886fb
commit 52fd4ff567
4 changed files with 44 additions and 1 deletions

36
modules/gitea/default.nix Normal file
View File

@ -0,0 +1,36 @@
{ domain, inputs }: { config, ... }:
{
age.secrets.giteaEnv.file = "${inputs.self}/scrts/gitea_env.age";
virtualisation.oci-containers = {
backend = "docker";
containers."gitea" = {
image = "gitea/gitea:1.17.3";
autoStart = true;
environment = {
PUID = "1000";
PGID = "100";
DB_TYPE = "mysql";
DB_HOST = "host.docker.internal:3306";
DB_NAME = "giteadb";
DB_USER = "gitea";
ROOT_URL = "${domain}";
INSTALL_LOCK = "true";
DISABLE_REGISTRATION = "true";
};
environmentFiles = [ config.age.secrets.giteaEnv.path ];
ports = [
"2222:22"
"8080:3000"
];
volumes = [
"/etc/timezone:/etc/timezone:ro"
"/etc/localtime:/etc/localtime:ro"
];
extraOptions = [
''--mount=type=volume,source=gitea_data,target=/data,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:/server_data/gitea/data,"volume-opt=o=addr=10.7.89.108,rw,nfsvers=4.0,nolock,hard,noatime"''
"--add-host=host.docker.internal:host-gateway"
];
};
};
}

BIN
scrts/gitea_env.age Normal file

Binary file not shown.

View File

@ -32,6 +32,7 @@ let
defaultKeys = [ andreas andreas-nixos-vm gwyn management nixos-vm ];
in
{
"gitea_env.age".publicKeys = defaultKeys ++ [ git ];
"pihole_env.age".publicKeys = defaultKeys ++ [ pihole ];
"plex_claim.age".publicKeys = defaultKeys ++ [ plex ];
"ttrss_env.age".publicKeys = defaultKeys ++ [ ttrss ];

View File

@ -1,4 +1,7 @@
{ custom, hostname, inputs }: { pkgs, ... }:
let
domain = "git.2li.ch";
in
{
imports = [
(import "${inputs.self}/systems/proxmox-vm" {
@ -9,7 +12,10 @@
time = "03:00"; inherit custom hostname inputs;
})
(import "${inputs.self}/modules/nginx-proxy" {
domain = "git.2li.ch"; inherit inputs;
inherit domain inputs;
})
(import "${inputs.self}/modules/gitea" {
inherit domain inputs;
})
"${inputs.self}/modules/docker"
"${inputs.self}/modules/mariadb"