extremist-software/modules/forgejo.nix

87 lines
1.9 KiB
Nix

{ config, pkgs, ... }:
let
customDir = "/var/lib/forgejo/custom";
themeCSS = ./forgejo-theme-gh-hc.css;
in
{
services.forgejo = {
enable = true;
database.type = "postgres";
lfs.enable = true;
settings = {
server = {
DOMAIN = "git.extremist.software";
ROOT_URL = "https://git.extremist.software/";
HTTP_PORT = 3000;
LANDING_PAGE = "/jet";
};
service = {
DISABLE_REGISTRATION = true;
SHOW_REGISTRATION_BUTTON = false;
EXPLORE_REQUIRE_SIGNIN_VIEW = true;
};
"service.explore" = {
DISABLE_USERS_PAGE = true;
DISABLE_ORGANIZATIONS_PAGE = true;
};
repository = {
DISABLE_STARS = true;
};
ui = {
DEFAULT_THEME = "gh-hc";
THEMES = "gh-hc,forgejo-auto,forgejo-light,forgejo-dark";
SHOW_USER_EMAIL = true;
};
"ui.meta" = {
AUTHOR = "jet";
DESCRIPTION = "Software extremist.";
KEYWORDS = "git,forgejo,jet,extremist";
};
other = {
SHOW_FOOTER_VERSION = false;
};
openid = {
ENABLE_OPENID_SIGNIN = false;
ENABLE_OPENID_SIGNUP = false;
};
actions = {
ENABLED = true;
};
};
database.passwordFile = config.age.secrets.forgejo-db.path;
};
services.postgresql.enable = true;
# Forgejo Actions runner
services.gitea-actions-runner = {
package = pkgs.forgejo-runner;
instances.default = {
enable = true;
name = "extremist-software";
url = "https://git.extremist.software";
tokenFile = config.age.secrets.forgejo-runner-token.path;
labels = [
"native:host"
];
};
};
# Deploy custom theme CSS to Forgejo's custom directory
systemd.tmpfiles.rules = [
"d ${customDir}/public/assets/css 0755 forgejo forgejo -"
];
systemd.services.forgejo.preStart = ''
cp ${themeCSS} ${customDir}/public/assets/css/theme-gh-hc.css
'';
}