diff --git a/module.nix b/module.nix index 625ba58..3f00b6b 100644 --- a/module.nix +++ b/module.nix @@ -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"; diff --git a/themes/catppuccin/default.nix b/themes/catppuccin/default.nix index 01e76a6..0181c34 100644 --- a/themes/catppuccin/default.nix +++ b/themes/catppuccin/default.nix @@ -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" + ]; }) - - diff --git a/themes/earl-grey/default.nix b/themes/earl-grey/default.nix index b5a5708..ce1003c 100644 --- a/themes/earl-grey/default.nix +++ b/themes/earl-grey/default.nix @@ -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" + ]; +}) diff --git a/themes/monokai/default.nix b/themes/monokai/default.nix index eba770a..920f43b 100644 --- a/themes/monokai/default.nix +++ b/themes/monokai/default.nix @@ -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" + ]; +}) diff --git a/themes/pitch-black/default.nix b/themes/pitch-black/default.nix index 677d166..903bfd5 100644 --- a/themes/pitch-black/default.nix +++ b/themes/pitch-black/default.nix @@ -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" + ]; +})