forgejo: switched to new service available in 23.11

This commit is contained in:
Fiscal Velvet Poet 2023-12-20 00:32:26 +10:00 committed by Fiscal Velvet Poet
parent df0f6a4a41
commit befaeac9ce
Signed by: fiscalvelvetpoet
GPG key ID: D8EBFD58B023BD47
2 changed files with 15 additions and 16 deletions

View file

@ -24,8 +24,8 @@
age.secrets = {
forgejo = {
file = ../../../secrets/forgejo.age;
owner = "gitea";
group = "gitea";
owner = "forgejo";
group = "forgejo";
};
};

View file

@ -8,7 +8,7 @@
flake = builtins.getFlake (toString ../.);
nixpkgsUnstable = flake.inputs.nixpkgsUnstable;
in {
services.gitea = {
services.forgejo = {
enable = true; # Enable Forgejo
appName = "Reciproka Kolectiva: Forgejo Service"; # Give the site a name
database = {
@ -17,7 +17,6 @@ in {
};
domain = "reciproka.dev"; # Domain name
httpPort = 3002; # Provided unique port
package = pkgs.forgejo; # a soft fork of gitea
rootUrl = "https://reciproka.dev/"; # Root web URL
settings = let
docutils = pkgs.python39.withPackages (ps:
@ -50,17 +49,17 @@ in {
};
ui = {
DEFAULT_THEME = "forgejo-auto"; # Set the default theme
THEMES = "forgejo-auto,forgejo-light,forgejo-dark,auto,arc-green,gitea";
THEMES = "forgejo-auto,forgejo-light,forgejo-dark,auto,arc-green,forgejo";
};
};
};
systemd = {
services = {
gitea = {
# Ensure gitea starts after keys are loaded
after = ["gitea-dbpass-key.service"];
wants = ["gitea-dbpass-key.service"];
forgejo = {
# Ensure forgejo starts after keys are loaded
after = ["forgejo-dbpass-key.service"];
wants = ["forgejo-dbpass-key.service"];
};
};
};
@ -68,20 +67,20 @@ in {
services.postgresql = {
enable = true; # Ensure postgresql is enabled
authentication = ''
local gitea all ident map=gitea-users
local forgejo all ident map=forgejo-users
'';
identMap =
# Map the gitea user to postgresql
# Map the forgejo user to postgresql
''
gitea-users gitea gitea
forgejo-users forgejo forgejo
'';
ensureDatabases = ["gitea"]; # Ensure the database persists
ensureDatabases = ["forgejo"]; # Ensure the database persists
ensureUsers = [
{
name = "gitea"; # Ensure the database user persists
name = "forgejo"; # Ensure the database user persists
ensurePermissions = {
# Ensure the database permissions persist
"DATABASE gitea" = "ALL PRIVILEGES";
"DATABASE forgejo" = "ALL PRIVILEGES";
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
};
}
@ -92,7 +91,7 @@ in {
services.postgresqlBackup = {
enable = true;
compression = "zstd";
databases = ["gitea"];
databases = ["forgejo"];
startAt = "*-*-* 15:00:00";
};