2022-05-14 18:35:41 +02:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gtk3
|
2022-12-09 20:58:03 +01:00
|
|
|
, colloid-gtk-theme
|
2022-05-14 18:35:41 +02:00
|
|
|
, gnome-themes-extra
|
|
|
|
, gtk-engine-murrine
|
2022-12-09 20:58:03 +01:00
|
|
|
, python3
|
2022-05-14 18:35:41 +02:00
|
|
|
, sassc
|
2022-12-09 20:58:03 +01:00
|
|
|
, accents ? [ "blue" ]
|
2022-08-02 19:39:51 +02:00
|
|
|
, size ? "standard"
|
2022-12-09 20:58:03 +01:00
|
|
|
, tweaks ? [ ]
|
|
|
|
, variant ? "frappe"
|
2022-05-14 18:35:41 +02:00
|
|
|
}:
|
|
|
|
let
|
2022-12-09 20:58:03 +01:00
|
|
|
validAccents = [ "blue" "flamingo" "green" "lavender" "maroon" "mauve" "peach" "pink" "red" "rosewater" "sapphire" "sky" "teal" "yellow" ];
|
2022-05-14 18:35:41 +02:00
|
|
|
validSizes = [ "standard" "compact" ];
|
2022-12-09 20:58:03 +01:00
|
|
|
validTweaks = [ "black" "rimless" "normal" ];
|
|
|
|
validVariants = [ "latte" "frappe" "macchiato" "mocha" ];
|
2022-05-14 18:35:41 +02:00
|
|
|
|
2022-12-09 20:58:03 +01:00
|
|
|
pname = "catppuccin-gtk";
|
2022-05-14 18:35:41 +02:00
|
|
|
in
|
|
|
|
|
2022-12-09 20:58:03 +01: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
|
2022-05-14 18:35:41 +02:00
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation rec {
|
2022-12-09 20:58:03 +01:00
|
|
|
inherit pname;
|
|
|
|
version = "0.4.1";
|
2022-05-14 18:35:41 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "catppuccin";
|
2022-12-09 20:58:03 +01:00
|
|
|
repo = "gtk";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-dzRXt9/OdPyiy3mu9pmPYeu69OXCnR+zEqbD1C5BKqM=";
|
2022-05-14 18:35:41 +02:00
|
|
|
};
|
|
|
|
|
2022-08-19 07:56:42 +02:00
|
|
|
nativeBuildInputs = [ gtk3 sassc ];
|
2022-05-14 18:35:41 +02:00
|
|
|
|
2022-12-09 20:58:03 +01:00
|
|
|
buildInputs = [
|
|
|
|
gnome-themes-extra
|
|
|
|
(python3.withPackages (ps: [ ps.catppuccin ]))
|
|
|
|
];
|
2022-05-14 18:35:41 +02:00
|
|
|
|
|
|
|
propagatedUserEnvPkgs = [ gtk-engine-murrine ];
|
|
|
|
|
2022-12-09 20:58:03 +01:00
|
|
|
postUnpack = ''
|
|
|
|
rm -rf source/colloid
|
|
|
|
cp -r ${colloid-gtk-theme.src} source/colloid
|
|
|
|
chmod -R +w source/colloid
|
|
|
|
'';
|
|
|
|
|
2022-05-14 18:35:41 +02:00
|
|
|
postPatch = ''
|
2022-12-09 20:58:03 +01:00
|
|
|
patchShebangs --build colloid/clean-old-theme.sh colloid/install.sh
|
2022-05-14 18:35:41 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2022-12-09 20:58:03 +01:00
|
|
|
mkdir -p $out/share/themes
|
2022-08-02 19:39:51 +02:00
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
|
2022-12-09 20:58:03 +01:00
|
|
|
python3 install.py ${variant} \
|
|
|
|
${lib.optionalString (accents != []) "--accent " + builtins.toString accents} \
|
|
|
|
${lib.optionalString (size != []) "--size " + size} \
|
|
|
|
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
|
|
|
|
--dest $out/share/themes
|
2022-05-14 18:35:41 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-08-02 19:39:51 +02:00
|
|
|
description = "Soothing pastel theme for GTK";
|
2022-05-14 18:35:41 +02:00
|
|
|
homepage = "https://github.com/catppuccin/gtk";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.fufexan ];
|
|
|
|
};
|
|
|
|
}
|