📦 add gitea

This commit is contained in:
James Walker 2021-10-13 21:11:36 -04:00
parent 66d78f6d68
commit beeb532c6c
Signed by: walkah
GPG Key ID: 3C127179D6086E93
4 changed files with 65 additions and 0 deletions

View File

@ -10,6 +10,7 @@ in {
../../modules/coredns
../../modules/code-server
../../modules/gitea
../../modules/home-assistant
../../modules/matrix
];
@ -149,6 +150,11 @@ in {
targets = [ "agent:5001" "form:5001" "matter:5001" "purpose:5001" ];
}];
}
{
job_name = "exportarr";
static_configs =
[{ targets = [ "plato:9707" "plato:9708" "plato:9709" ]; }];
}
];
};
};

View File

@ -11,6 +11,7 @@ in {
../../modules/coredns
../../modules/code-server/nginx.nix
../../modules/gitea/nginx.nix
../../modules/home-assistant/nginx.nix
../../modules/matrix/nginx.nix
];

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

@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
let cfg = config.services.gitea;
in {
users.users.git = {
description = "Gitea Service";
home = cfg.stateDir;
useDefaultShell = true;
group = "git";
isSystemUser = true;
};
users.groups.git = { };
services.gitea = {
enable = true;
user = "git";
domain = "walkah.dev";
appName = "walkah forge";
rootUrl = "https://walkah.dev/";
httpAddress = "0.0.0.0";
httpPort = 8003;
log.level = "Error";
lfs.enable = true;
disableRegistration = true;
cookieSecure = true;
settings = {
other.SHOW_FOOTER_VERSION = false;
repository.DEFAULT_BRANCH = "main";
server.SSH_DOMAIN = "git.walkah.dev";
};
dump.enable = false;
database = {
type = "postgres";
user = "git";
};
};
}

17
modules/gitea/nginx.nix Normal file
View File

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
{
services.nginx = {
enable = true;
virtualHosts = {
"walkah.dev" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://plato:8003";
proxyWebsockets = true;
};
};
};
};
}