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; }; "postgres-pw" = { owner = config.services.gitea.user; };
}; };
environment.systemPackages = with pkgs; [
gitea
];
users = { users = {
users = { users = {
"${user}".extraGroups = [ git-user ]; "${user}".extraGroups = [ git-user ];
@@ -33,8 +30,8 @@ let git-user = "git"; in
# camoHmacKeyFile = ; # camoHmacKeyFile = ;
database = { database = {
createDatabase = false; # default createDatabase = false; # default
host = "127.0.0.1"; # default host = config.services.postgresql.settings.listen_addresses;
port = 5432; port = config.services.postgresql.settings.port;
passwordFile = config.sops.secrets."postgres-pw".path; passwordFile = config.sops.secrets."postgres-pw".path;
socket = null; socket = null;
type = "postgres"; type = "postgres";
@@ -66,12 +63,12 @@ let git-user = "git"; in
START_SSH_SERVER = false; # default START_SSH_SERVER = false; # default
SSH_LISTEN_HOST = "0.0.0.0"; SSH_LISTEN_HOST = "0.0.0.0";
SSH_PORT = secrets.ssh.port; SSH_PORT = secrets.ssh.port;
DOMAIN = "pw.${domain}"; DOMAIN = "git.${domain}";
SSH_DOMAIN = "ssh.${domain}"; SSH_DOMAIN = "ssh.${domain}";
# HTTP_ADDR = "${config.services.gitea.settings.server.DOMAIN}"; # HTTP_ADDR = "${config.services.gitea.settings.server.DOMAIN}";
# HTTP_PORT = 3000; # default # HTTP_PORT = 3000; # default
# PROTOCOL = "http"; # default # PROTOCOL = "http"; # default
# ROOT_URL = "https:pw.${domain}/"; # default ROOT_URL = "https://git.${domain}/"; # default
}; };
session = { session = {
COOKIE_SECURE = true; COOKIE_SECURE = true;
@@ -79,6 +76,31 @@ let git-user = "git"; in
service = { service = {
DISABLE_REGISTRATION = true; 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/
'';
};
} }

View File

@@ -27,7 +27,7 @@
]; ];
settings = { settings = {
port = 5432; # default port = 5432; # default
listen_addresses = "localhost"; listen_addresses = lib.mkForce "127.0.0.1";
log_line_prefix = "[%p] "; # default log_line_prefix = "[%p] "; # default
shared_preload_libraries = [ ]; # default shared_preload_libraries = [ ]; # default
}; };