feat: add configuration to forgejo to be more cute

This commit is contained in:
Jet Pham 2026-03-10 15:51:13 -07:00
parent 9dd83c5b92
commit 4ae2f50adc
No known key found for this signature in database
4 changed files with 484 additions and 2 deletions

View file

@ -1,21 +1,87 @@
{ config, pkgs, ... }:
let
customDir = "/var/lib/forgejo/custom";
themeCSS = ./forgejo-theme-gh-hc.css;
in
{
services.forgejo = {
enable = true;
database.type = "postgres";
# Enable support for Large File Storage
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;
};
# You can configure SMTP here using secrets if needed
};
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
'';
}