adding gitea
This commit is contained in:
93
system-config/services/containers/gitea/default.nix
Normal file
93
system-config/services/containers/gitea/default.nix
Normal file
@@ -0,0 +1,93 @@
|
||||
{ config, lib, pkgs, ... }: {
|
||||
|
||||
options.sysconfig.opts.virtualization.gitea.enable = lib.options.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.opts.virtualization.gitea.enable {
|
||||
|
||||
sops.secrets = {
|
||||
"gitea/db_pass" = {};
|
||||
};
|
||||
|
||||
services.openssh.ports = [
|
||||
2222
|
||||
];
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
22
|
||||
2222
|
||||
];
|
||||
|
||||
containers.gitea = {
|
||||
|
||||
autoStart = true;
|
||||
privateNetwork = true;
|
||||
hostAddress = "192.168.100.10";
|
||||
localAddress = "192.168.100.20";
|
||||
|
||||
forwardPorts = [
|
||||
{
|
||||
containerPort = 22;
|
||||
hostPort = 22;
|
||||
}
|
||||
];
|
||||
|
||||
bindMounts = {
|
||||
"/etc/gitea/data" = {
|
||||
hostPath = "/ssd1/Gitea/data";
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
||||
extraFlags = [
|
||||
"--load-credential=dbpass:${config.sops.secrets."gitlab/db_pass".path}"
|
||||
];
|
||||
config = {
|
||||
|
||||
systemd.services.secrets_setup = {
|
||||
wantedBy = [ "gitea.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
LoadCredential = [
|
||||
"dbpass"
|
||||
];
|
||||
};
|
||||
|
||||
script = ''
|
||||
cat ''${CREDENTIALS_DIRECTORY}/dbpass > /etc/gitea/dbpass
|
||||
chown gitea:gitea /etc/gitea/*
|
||||
'';
|
||||
};
|
||||
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
|
||||
stateDir = "/etc/gitea/data";
|
||||
|
||||
dump.enable = true;
|
||||
|
||||
settings = {
|
||||
server = {
|
||||
DOMAIN = "gitea.blunkall.us";
|
||||
HTTP_PORT = 80;
|
||||
};
|
||||
service.DISABLE_REGISTRATION = false;
|
||||
session.COOKIE_SECURE = true;
|
||||
};
|
||||
|
||||
database = {
|
||||
passwordFile = "/etc/gitea/dbpass";
|
||||
type = "postgres";
|
||||
};
|
||||
};
|
||||
services.openssh.enable = true;
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 22 80 ];
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -165,7 +165,6 @@
|
||||
service = "authentik";
|
||||
tls.certResolver = "cloudflare";
|
||||
};
|
||||
|
||||
gitlab = {
|
||||
entryPoints = [ "localsecure" "websecure" ];
|
||||
rule = "Host(`gitlab.blunkall.us`)";
|
||||
@@ -173,6 +172,13 @@
|
||||
tls.certResolver = "cloudflare";
|
||||
};
|
||||
|
||||
gitea = {
|
||||
entryPoints = [ "localsecure" "websecure" ];
|
||||
rule = "Host(`gitea.blunkall.us`)";
|
||||
service = "gitea";
|
||||
tls.certResolver = "cloudflare";
|
||||
};
|
||||
|
||||
nextcloud = {
|
||||
entryPoints = [ "localsecure" "websecure" ];
|
||||
rule = "Host(`nextcloud.blunkall.us`)";
|
||||
@@ -234,6 +240,7 @@
|
||||
|
||||
services = {
|
||||
gitlab.loadBalancer.servers = [ { url = "http://192.168.100.16:80"; } ];
|
||||
gitea.loadBalancer.servers = [ { url = "http://192.168.100.20:80"; } ];
|
||||
|
||||
homepage.loadBalancer.servers = [ { url = "http://192.168.100.13:80"; } ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user