From f41904260bacd6be3d91f23a0da9af1b92b36640 Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Fri, 16 Aug 2024 22:34:35 -0700 Subject: [PATCH] Added catppuccin themes to gitea --- modules/nixos/services/gitea/default.nix | 13 ++++++++++++ packages/catppuccin-gitea/default.nix | 26 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 packages/catppuccin-gitea/default.nix diff --git a/modules/nixos/services/gitea/default.nix b/modules/nixos/services/gitea/default.nix index 7fe07e0..d939908 100644 --- a/modules/nixos/services/gitea/default.nix +++ b/modules/nixos/services/gitea/default.nix @@ -1,6 +1,7 @@ { config, lib, + pkgs, namespace, ... }: let @@ -42,9 +43,21 @@ in { service.DISABLE_REGISTRATION = true; webhook.ALLOWED_HOST_LIST = "hydra.kilonull.com"; + + ui.THEMES = '' + catppuccin-latte-rosewater,catppuccin-latte-flamingo,catppuccin-latte-pink,catppuccin-latte-mauve,catppuccin-latte-red,catppuccin-latte-maroon,catppuccin-latte-peach,catppuccin-latte-yellow,catppuccin-latte-green,catppuccin-latte-teal,catppuccin-latte-sky,catppuccin-latte-sapphire,catppuccin-latte-blue,catppuccin-latte-lavender,catppuccin-frappe-rosewater,catppuccin-frappe-flamingo,catppuccin-frappe-pink,catppuccin-frappe-mauve,catppuccin-frappe-red,catppuccin-frappe-maroon,catppuccin-frappe-peach,catppuccin-frappe-yellow,catppuccin-frappe-green,catppuccin-frappe-teal,catppuccin-frappe-sky,catppuccin-frappe-sapphire,catppuccin-frappe-blue,catppuccin-frappe-lavender,catppuccin-macchiato-rosewater,catppuccin-macchiato-flamingo,catppuccin-macchiato-pink,catppuccin-macchiato-mauve,catppuccin-macchiato-red,catppuccin-macchiato-maroon,catppuccin-macchiato-peach,catppuccin-macchiato-yellow,catppuccin-macchiato-green,catppuccin-macchiato-teal,catppuccin-macchiato-sky,catppuccin-macchiato-sapphire,catppuccin-macchiato-blue,catppuccin-macchiato-lavender,catppuccin-mocha-rosewater,catppuccin-mocha-flamingo,catppuccin-mocha-pink,catppuccin-mocha-mauve,catppuccin-mocha-red,catppuccin-mocha-maroon,catppuccin-mocha-peach,catppuccin-mocha-yellow,catppuccin-mocha-green,catppuccin-mocha-teal,catppuccin-mocha-sky,catppuccin-mocha-sapphire,catppuccin-mocha-blue,catppuccin-mocha-lavender + ''; }; }; + systemd.tmpfiles.rules = [ + "d '${gitea_cfg.customDir}/public' 0750 ${gitea_cfg.user} ${gitea_cfg.group} - -" + "z '${gitea_cfg.customDir}/public' 0750 ${gitea_cfg.user} ${gitea_cfg.group} - -" + "d '${gitea_cfg.customDir}/public/assets' 0750 ${gitea_cfg.user} ${gitea_cfg.group} - -" + "z '${gitea_cfg.customDir}/public/assets' 0750 ${gitea_cfg.user} ${gitea_cfg.group} - -" + "L+ '${gitea_cfg.customDir}/public/assets/css' - - - - ${pkgs.aa.catppuccin-gitea}/share/gitea-themes" + ]; + services.nginx = { enable = true; virtualHosts."gitea.kilonull.com" = diff --git a/packages/catppuccin-gitea/default.nix b/packages/catppuccin-gitea/default.nix new file mode 100644 index 0000000..b51d99e --- /dev/null +++ b/packages/catppuccin-gitea/default.nix @@ -0,0 +1,26 @@ +{ + stdenv, + fetchurl, + ... +}: +stdenv.mkDerivation { + pname = "catppuccin-gitea"; + version = "0.4.1"; + + src = fetchurl { + url = "https://github.com/catppuccin/gitea/releases/download/v0.4.1/catppuccin-gitea.tar.gz"; + hash = "sha256-/P4fLvswitlfeaKaUykrEKvjbNpw5Q/nzGQ/GZaLyUI="; + }; + + dontBuild = true; + + unpackPhase = '' + mkdir themes + tar xf "$src" --mode=+w --warning=no-timestamp -C themes + ''; + + installPhase = '' + mkdir -p "$out/share/gitea-themes" + cp -r themes/*.css "$out/share/gitea-themes/" + ''; +}