2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gtk3
|
2023-01-20 10:41:00 +00:00
|
|
|
, colloid-gtk-theme
|
2022-06-16 17:23:12 +00:00
|
|
|
, gnome-themes-extra
|
|
|
|
, gtk-engine-murrine
|
2023-01-20 10:41:00 +00:00
|
|
|
, python3
|
2022-06-16 17:23:12 +00:00
|
|
|
, sassc
|
2024-01-02 11:29:13 +00:00
|
|
|
, nix-update-script
|
2023-01-20 10:41:00 +00:00
|
|
|
, accents ? [ "blue" ]
|
2022-08-12 12:06:08 +00:00
|
|
|
, size ? "standard"
|
2023-01-20 10:41:00 +00:00
|
|
|
, tweaks ? [ ]
|
|
|
|
, variant ? "frappe"
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
let
|
2023-01-20 10:41:00 +00:00
|
|
|
validAccents = [ "blue" "flamingo" "green" "lavender" "maroon" "mauve" "peach" "pink" "red" "rosewater" "sapphire" "sky" "teal" "yellow" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
validSizes = [ "standard" "compact" ];
|
2024-01-13 08:15:51 +00:00
|
|
|
validTweaks = [ "black" "rimless" "normal" "float" ];
|
2023-01-20 10:41:00 +00:00
|
|
|
validVariants = [ "latte" "frappe" "macchiato" "mocha" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
pname = "catppuccin-gtk";
|
2022-06-16 17:23:12 +00:00
|
|
|
in
|
|
|
|
|
2023-01-20 10:41:00 +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
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation rec {
|
2023-01-20 10:41:00 +00:00
|
|
|
inherit pname;
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "0.7.5";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "catppuccin";
|
2023-01-20 10:41:00 +00:00
|
|
|
repo = "gtk";
|
|
|
|
rev = "v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-DIeMdkEjIcPIf/EgE83F5URHY+lR2+hxdc4wSrruFJ8=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [ gtk3 sassc ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [
|
|
|
|
./colloid-src-git-reset.patch
|
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
buildInputs = [
|
|
|
|
gnome-themes-extra
|
|
|
|
(python3.withPackages (ps: [ ps.catppuccin ]))
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
propagatedUserEnvPkgs = [ gtk-engine-murrine ];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
postUnpack = ''
|
|
|
|
rm -rf source/colloid
|
|
|
|
cp -r ${colloid-gtk-theme.src} source/colloid
|
|
|
|
chmod -R +w source/colloid
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
patchShebangs --build colloid/install.sh colloid/build.sh
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
cp -r colloid colloid-base
|
2023-01-20 10:41:00 +00:00
|
|
|
mkdir -p $out/share/themes
|
2022-08-12 12:06:08 +00:00
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
|
2023-01-20 10:41:00 +00: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-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
2022-08-12 12:06:08 +00:00
|
|
|
description = "Soothing pastel theme for GTK";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/catppuccin/gtk";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ fufexan dixslyf ];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|