gitea (theme&++)

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2024-12-15 15:31:43 +01:00
parent d2e0b9d2d3
commit d9822a7a91
2 changed files with 30 additions and 8 deletions

View File

@@ -5,9 +5,6 @@ let git-user = "git"; in
"postgres-pw" = { owner = config.services.gitea.user; };
};
environment.systemPackages = with pkgs; [
gitea
];
users = {
users = {
"${user}".extraGroups = [ git-user ];
@@ -33,8 +30,8 @@ let git-user = "git"; in
# camoHmacKeyFile = ;
database = {
createDatabase = false; # default
host = "127.0.0.1"; # default
port = 5432;
host = config.services.postgresql.settings.listen_addresses;
port = config.services.postgresql.settings.port;
passwordFile = config.sops.secrets."postgres-pw".path;
socket = null;
type = "postgres";
@@ -66,12 +63,12 @@ let git-user = "git"; in
START_SSH_SERVER = false; # default
SSH_LISTEN_HOST = "0.0.0.0";
SSH_PORT = secrets.ssh.port;
DOMAIN = "pw.${domain}";
DOMAIN = "git.${domain}";
SSH_DOMAIN = "ssh.${domain}";
# HTTP_ADDR = "${config.services.gitea.settings.server.DOMAIN}";
# HTTP_PORT = 3000; # default
# PROTOCOL = "http"; # default
# ROOT_URL = "https:pw.${domain}/"; # default
ROOT_URL = "https://git.${domain}/"; # default
};
session = {
COOKIE_SECURE = true;
@@ -79,6 +76,31 @@ let git-user = "git"; in
service = {
DISABLE_REGISTRATION = true;
};
ui = {
DEFAULT_THEME = "pitchblack";
THEMES = "gitea,arc-green,pitchblack";
};
};
};
system.activationScripts = let
# theme = pkgs.fetchFromGitHub {
# owner = "unixtensor";
# repo = "Gitea-Pitch-Black";
# rev = "v1.15.X.2";
# hash = "sha256-Eibgoc3BJUXWdq8irgXea09fAvfKx2eQrJotp3P5DTg=";
# };
theme = pkgs.fetchFromGitea {
domain = "git.${domain}";
owner = "nx2";
repo = "Gitea-Pitch-Black";
rev = "0.1.0";
hash = "sha256-pU4YhgcPOT3PTcmBTjNE3FcyJgl39JGP41ckhRUKN7Y=";
};
in {
"gitea-theme" = /* bash */ ''
mkdir -p ${config.services.gitea.stateDir}/custom/public/assets/css/
ln -s ${theme}/theme-pitchblack.css ${config.services.gitea.stateDir}/custom/public/assets/css/theme-pitchblack.css
chown -R ${git-user}:${git-user} ${config.services.gitea.stateDir}/custom/
'';
};
}