Compare commits

...

3 Commits

Author SHA1 Message Date
007038f1be
fix: home directory option for git
Signed-off-by: Chinmay D. Pai <chinmay.pai@zerodha.com>
2023-11-27 09:45:51 +05:30
ed93ea978e
chore: add ssh domain for cloning
Signed-off-by: Chinmay D. Pai <chinmay.pai@zerodha.com>
2023-11-27 09:43:49 +05:30
1dd6397914
chore: create git user for gitea
Signed-off-by: Chinmay D. Pai <chinmay.pai@zerodha.com>
2023-11-27 09:39:19 +05:30

View File

@ -1,5 +1,6 @@
{config, ...}: let {config, ...}: let
domain = "git.deku.moe"; domain = "git.deku.moe";
sshDomain = "git-ssh.deku.moe";
httpPort = 3001; httpPort = 3001;
sshPort = 22022; sshPort = 22022;
in { in {
@ -9,16 +10,6 @@ in {
group = config.services.gitea.user; group = config.services.gitea.user;
}; };
services.postgresql = {
ensureDatabases = [config.services.gitea.user];
ensureUsers = [
{
name = config.services.gitea.database.user;
ensureDBOwnership = true;
}
];
};
services.gitea = { services.gitea = {
enable = true; enable = true;
lfs.enable = true; lfs.enable = true;
@ -27,6 +18,7 @@ in {
database = { database = {
type = "postgres"; type = "postgres";
passwordFile = config.age.secrets.gitea.path; passwordFile = config.age.secrets.gitea.path;
name = config.services.gitea.user;
user = config.services.gitea.user; user = config.services.gitea.user;
}; };
@ -42,6 +34,7 @@ in {
HTTP_ADDR = "127.0.0.1"; HTTP_ADDR = "127.0.0.1";
HTTP_PORT = httpPort; HTTP_PORT = httpPort;
ROOT_URL = "https://${domain}/"; ROOT_URL = "https://${domain}/";
SSH_DOMAIN = sshDomain;
SSH_PORT = sshPort; SSH_PORT = sshPort;
}; };
service = { service = {
@ -64,6 +57,15 @@ in {
}; };
}; };
users.users.git = {
description = "Gitea Service";
home = config.services.gitea.stateDir;
useDefaultShell = true;
group = "git";
isSystemUser = true;
};
users.groups.git = {};
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
email = "chinmaydpai@gmail.com"; email = "chinmaydpai@gmail.com";