depot/pkgs/by-name/gr/gruvbox-gtk-theme/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

122 lines
2.7 KiB
Nix

{
lib,
stdenvNoCC,
fetchFromGitHub,
sassc,
gnome-themes-extra,
gtk-engine-murrine,
unstableGitUpdater,
colorVariants ? [ ],
sizeVariants ? [ ],
themeVariants ? [ ],
tweakVariants ? [ ],
iconVariants ? [ ],
}:
let
pname = "gruvbox-gtk-theme";
colorVariantList = [
"dark"
"light"
];
sizeVariantList = [
"compact"
"standard"
];
themeVariantList = [
"default"
"green"
"grey"
"orange"
"pink"
"purple"
"red"
"teal"
"yellow"
"all"
];
tweakVariantList = [
"medium"
"soft"
"black"
"float"
"outline"
"macos"
];
iconVariantList = [
"Dark"
"Light"
];
in
lib.checkListOfEnum "${pname}: colorVariants" colorVariantList colorVariants lib.checkListOfEnum
"${pname}: sizeVariants"
sizeVariantList
sizeVariants
lib.checkListOfEnum
"${pname}: themeVariants"
themeVariantList
themeVariants
lib.checkListOfEnum
"${pname}: tweakVariants"
tweakVariantList
tweakVariants
lib.checkListOfEnum
"${pname}: iconVariants"
iconVariantList
iconVariants
stdenvNoCC.mkDerivation
{
inherit pname;
version = "0-unstable-2024-11-06";
src = fetchFromGitHub {
owner = "Fausto-Korpsvart";
repo = "Gruvbox-GTK-Theme";
rev = "d064cd480a1e4802851b35bf051e48c808802c2a";
hash = "sha256-LOizbRbPj3X0B0bED6fRcwxYeRFY8vtLk0i64pqyIyY=";
};
propagatedUserEnvPkgs = [ gtk-engine-murrine ];
nativeBuildInputs = [ sassc ];
buildInputs = [ gnome-themes-extra ];
dontBuild = true;
passthru.updateScript = unstableGitUpdater { };
postPatch = ''
patchShebangs themes/install.sh
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/themes
cd themes
./install.sh -n Gruvbox \
${lib.optionalString (colorVariants != [ ]) "-c " + toString colorVariants} \
${lib.optionalString (sizeVariants != [ ]) "-s " + toString sizeVariants} \
${lib.optionalString (themeVariants != [ ]) "-t " + toString themeVariants} \
${lib.optionalString (tweakVariants != [ ]) "--tweaks " + toString tweakVariants} \
-d "$out/share/themes"
cd ../icons
${lib.optionalString (iconVariants != [ ]) ''
mkdir -p $out/share/icons
cp -a ${toString (map (v: "Gruvbox-${v}") iconVariants)} $out/share/icons/
''}
runHook postInstall
'';
meta = {
description = "GTK theme based on the Gruvbox colour palette";
homepage = "https://github.com/Fausto-Korpsvart/Gruvbox-GTK-Theme";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [
luftmensch-luftmensch
math-42
d3vil0p3r
];
};
}