nixos-config/config/services/gitea.nix

93 lines
2.5 KiB
Nix
Raw Normal View History

2023-01-01 14:28:25 +01:00
{
pkgs,
config,
...
}: {
2022-02-18 14:17:35 +01:00
imports = [
../../modules/gitea.nix
];
2022-01-17 10:49:37 +01:00
services.gitea = {
2023-03-25 20:40:44 +01:00
package = pkgs.forgejo;
2022-01-17 10:49:37 +01:00
enable = true;
appName = "Lotte's Git";
2022-01-17 10:53:15 +01:00
cookieSecure = true;
2022-01-17 10:49:37 +01:00
database = {
host = "localhost";
name = "gitea";
user = "gitea";
2022-01-17 11:36:05 +01:00
type = "postgres";
2022-01-17 10:49:37 +01:00
};
domain = "git.chir.rs";
httpAddress = "127.0.0.1";
lfs.enable = true;
rootUrl = "https://git.chir.rs/";
2022-01-30 14:09:25 +01:00
storageSecretFile = "/run/secrets/services/gitea";
2022-01-17 11:37:34 +01:00
settings = rec {
2022-01-17 10:49:37 +01:00
storage = {
STORAGE_TYPE = "minio";
2023-10-01 15:47:26 +01:00
MINIO_ENDPOINT = "ams1.vultrobjects.com";
MINIO_ACCESS_KEY_ID = "X86D3HKJ3Y92IASK0XIG";
2022-01-30 13:50:23 +01:00
MINIO_SECRET_ACCESS_KEY = "#storageSecret#";
2023-03-25 20:36:48 +01:00
MINIO_BUCKET = "git-chir-rs";
MINIO_USE_SSL = "true";
2022-01-17 10:49:37 +01:00
};
2022-01-17 13:48:48 +01:00
openid = {
ENABLE_OPENID_SIGNIN = true;
ENABLE_OPENID_SIGNUP = true;
};
cache = {
2022-01-17 13:50:25 +01:00
ENABLED = config.services.redis.servers.gitea.enable;
2022-01-17 13:48:48 +01:00
ADAPTER = "redis";
2022-01-17 13:51:14 +01:00
HOST = "redis://${config.services.redis.servers.gitea.bind}:${toString config.services.redis.servers.gitea.port}/0";
2022-01-17 13:48:48 +01:00
};
session = {
PROVIDER = "redis";
PROVIDER_CONFIG = "redis://${config.services.redis.servers.gitea.bind}:${toString config.services.redis.servers.gitea.port}/1";
};
metrics = {
ENABLED = true;
ENABLED_ISSUE_BY_LABEL = true;
ENABLED_ISSUE_BY_REPOSITORY = true;
};
queue = {
TYPE = "redis";
CONN_STRING = "redis://${config.services.redis.servers.gitea.bind}:${toString config.services.redis.servers.gitea.port}/2";
};
2022-06-26 07:59:19 +01:00
packages.ENABLED = true;
2022-07-02 19:34:25 +01:00
federation.ENABLED = true;
2022-07-04 10:27:43 +01:00
"repository.signing" = {
2023-04-08 14:17:26 +01:00
SIGNING_KEY = "823566455E49DDC6AE5813048CA13817A54AAB38";
2022-07-04 10:17:48 +01:00
SIGNING_NAME = "Gitea";
SIGNING_EMAIL = "gitea@chir.rs";
INITIAL_COMMIT = "always";
WIKI = "always";
CRUD_ACTIONS = "always";
MERGES = "always";
};
2023-04-08 14:17:26 +01:00
git = {
HOME_PATH = "/var/lib/gitea";
};
2022-01-17 10:49:37 +01:00
};
};
2022-08-26 16:28:14 +01:00
services.caddy.virtualHosts."git.chir.rs" = {
useACMEHost = "chir.rs";
2022-12-30 14:03:57 +01:00
logFormat = pkgs.lib.mkForce "";
2022-08-26 16:28:14 +01:00
extraConfig = ''
import baseConfig
reverse_proxy http://${config.services.gitea.httpAddress}:${toString config.services.gitea.httpPort}
'';
2022-01-17 10:53:15 +01:00
};
2022-06-12 16:39:15 +01:00
services.postgresql.ensureDatabases = ["gitea"];
2022-01-17 10:49:37 +01:00
2022-01-17 13:50:25 +01:00
services.redis.servers.gitea = {
2022-01-17 13:48:48 +01:00
enable = true;
bind = "127.0.0.1";
databases = 3;
2022-01-23 10:55:17 +01:00
port = 6379;
2022-01-17 13:48:48 +01:00
};
2022-06-12 16:39:15 +01:00
sops.secrets."services/gitea" = {owner = "gitea";};
2022-01-17 10:49:37 +01:00
}