nixpkgs/pkgs/by-name/ca/catppuccin-gtk/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
2.0 KiB
Nix
Raw Normal View History

{ lib
, stdenvNoCC
, fetchFromGitHub
, gtk3
2024-06-10 13:15:52 +00:00
, git
2022-12-09 19:58:03 +00:00
, python3
, sassc
2023-11-22 03:32:02 +00:00
, nix-update-script
2022-12-09 19:58:03 +00:00
, accents ? [ "blue" ]
, size ? "standard"
2022-12-09 19:58:03 +00:00
, tweaks ? [ ]
, variant ? "frappe"
}:
let
2022-12-09 19:58:03 +00:00
validAccents = [ "blue" "flamingo" "green" "lavender" "maroon" "mauve" "peach" "pink" "red" "rosewater" "sapphire" "sky" "teal" "yellow" ];
validSizes = [ "standard" "compact" ];
validTweaks = [ "black" "rimless" "normal" "float" ];
2022-12-09 19:58:03 +00:00
validVariants = [ "latte" "frappe" "macchiato" "mocha" ];
2022-12-09 19:58:03 +00:00
pname = "catppuccin-gtk";
2024-06-10 13:15:52 +00:00
version = "1.0.3";
in
2022-12-09 19:58:03 +00:00
lib.checkListOfEnum "${pname}: theme accent" validAccents accents
lib.checkListOfEnum "${pname}: color variant" validVariants [variant]
lib.checkListOfEnum "${pname}: size variant" validSizes [size]
lib.checkListOfEnum "${pname}: tweaks" validTweaks tweaks
2024-06-10 13:15:52 +00:00
stdenvNoCC.mkDerivation {
inherit pname version;
src = fetchFromGitHub {
owner = "catppuccin";
2022-12-09 19:58:03 +00:00
repo = "gtk";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-q5/VcFsm3vNEw55zq/vcM11eo456SYE5TQA3g2VQjGc=";
};
patches = [ ./fix-inconsistent-theme-name.patch ];
2024-06-10 13:15:52 +00:00
nativeBuildInputs = [
gtk3
sassc
# git is needed here since "git apply" is being used for patches
# see <https://github.com/catppuccin/gtk/blob/4173b70b910bbb3a42ef0e329b3e98d53cef3350/build.py#L465>
git
2022-12-09 19:58:03 +00:00
(python3.withPackages (ps: [ ps.catppuccin ]))
];
2023-09-23 07:52:02 +00:00
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
2022-12-09 19:58:03 +00:00
mkdir -p $out/share/themes
2024-06-10 13:15:52 +00:00
python3 build.py ${variant} \
--accent ${builtins.toString accents} \
${lib.optionalString (size != [ ]) "--size " + size} \
${lib.optionalString (tweaks != [ ]) "--tweaks " + builtins.toString tweaks} \
2022-12-09 19:58:03 +00:00
--dest $out/share/themes
runHook postInstall
'';
2023-11-22 03:32:02 +00:00
passthru.updateScript = nix-update-script { };
2024-06-10 13:15:52 +00:00
meta = {
description = "Soothing pastel theme for GTK";
homepage = "https://github.com/catppuccin/gtk";
2024-06-10 13:15:52 +00:00
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ fufexan dixslyf isabelroses ];
};
}