treewide: note gitea theme names in passthru attr

This commit is contained in:
Oystein Kristoffer Tveit 2025-04-05 21:29:26 +02:00
parent 3c12637718
commit db2e4becf1
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
5 changed files with 49 additions and 13 deletions
module.nix
themes
catppuccin
earl-grey
monokai
pitch-black

@ -18,7 +18,7 @@ in
services.gitea.settings.ui.THEMES = lib.strings.concatStringsSep "," ([
"gitea"
"arc-green"
] ++ lib.attrNames cfg);
] ++ (lib.concatMap (drv: drv.passthru.gitea-themes) (lib.attrValues cfg)));
systemd.services.install-gitea-themes = {
description = "Install gitea themes in gitea's CUSTOM_DIR";

@ -1,5 +1,5 @@
{
deno
{ lib
, deno
, fetchzip
, stdenv
}:
@ -18,11 +18,35 @@ stdenv.mkDerivation (finalAttrs: {
installPhase = ''
runHook preInstall
mkdir -p "$out/share/gitea/public/assets/css"
mv *.css "$out/share/gitea/public/assets/css"
mv *.css "$out/share/gitea/public/assets/css"
runHook postInstall
'';
passthru.gitea-themes = (lib.mapCartesianProduct ({ variant, color }: "catppuccin-${variant}-${color}") {
variant = [
"frappe"
"latte"
];
color = [
"blue"
"flamingo"
"green"
"lavender"
"maroon"
"mauve"
"peach"
"pink"
"red"
"rosewater"
"sapphire"
"sky"
"teal"
"yellow"
];
}) ++ [
"catppuccin-blue-auto"
"catppuccin-flamingo-auto"
"catppuccin-green-auto"
"catppuccin-lavender-auto"
];
})

@ -1,7 +1,11 @@
{ runCommand
}:
runCommand "gitea-earl-grey-theme" {
(runCommand "gitea-earl-grey-theme" {
} ''
install -D ${./theme-earl-grey.css} $out/share/gitea/public/assets/css/theme-earl-grey.css
''
'').overrideAttrs(_: {
passthru.gitea-themes = [
"earl-grey"
];
})

@ -2,9 +2,13 @@
, lessc
}:
runCommand "gitea-monokai-theme" {
(runCommand "gitea-monokai-theme" {
buildInputs = [ lessc ];
} ''
mkdir $out
lessc ${./theme-monokai.less} $out/share/gitea/public/assets/css/theme-monokai.css
''
'').overrideAttrs(_: {
passthru.gitea-themes = [
"monokai"
];
})

@ -3,11 +3,15 @@
, lessc
}:
runCommand "gitea-pitch-black-theme" {
(runCommand "gitea-pitch-black-theme" {
nativeBuildInputs = [ lessc ];
} ''
mkdir -p css/theme-pitch-black/
cp "${./theme-pitch-black.less}" css/theme-pitch-black/theme-pitch-black.less
ln -s ${gitea.src}/web_src/css/chroma css/chroma
lessc css/theme-pitch-black/theme-pitch-black.less $out/share/gitea/public/assets/css/theme-pitch-black.css
''
'').overrideAttrs(_: {
passthru.gitea-themes = [
"pitch-black"
];
})