nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 122 lines 2.8 kB view raw
1{ 2 lib, 3 stdenvNoCC, 4 fetchFromGitHub, 5 sassc, 6 gnome-themes-extra, 7 gtk-engine-murrine, 8 unstableGitUpdater, 9 colorVariants ? [ ], 10 sizeVariants ? [ ], 11 themeVariants ? [ ], 12 tweakVariants ? [ ], 13 iconVariants ? [ ], 14}: 15 16let 17 pname = "gruvbox-gtk-theme"; 18 colorVariantList = [ 19 "dark" 20 "light" 21 ]; 22 sizeVariantList = [ 23 "compact" 24 "standard" 25 ]; 26 themeVariantList = [ 27 "default" 28 "green" 29 "grey" 30 "orange" 31 "pink" 32 "purple" 33 "red" 34 "teal" 35 "yellow" 36 "all" 37 ]; 38 tweakVariantList = [ 39 "medium" 40 "soft" 41 "black" 42 "float" 43 "outline" 44 "macos" 45 ]; 46 iconVariantList = [ 47 "Dark" 48 "Light" 49 ]; 50in 51lib.checkListOfEnum "${pname}: colorVariants" colorVariantList colorVariants lib.checkListOfEnum 52 "${pname}: sizeVariants" 53 sizeVariantList 54 sizeVariants 55 lib.checkListOfEnum 56 "${pname}: themeVariants" 57 themeVariantList 58 themeVariants 59 lib.checkListOfEnum 60 "${pname}: tweakVariants" 61 tweakVariantList 62 tweakVariants 63 lib.checkListOfEnum 64 "${pname}: iconVariants" 65 iconVariantList 66 iconVariants 67 68 stdenvNoCC.mkDerivation 69 { 70 inherit pname; 71 version = "0-unstable-2025-07-21"; 72 73 src = fetchFromGitHub { 74 owner = "Fausto-Korpsvart"; 75 repo = "Gruvbox-GTK-Theme"; 76 rev = "b1cfcc8a3b461f227c8a89dee17a80ed8f6656f4"; 77 hash = "sha256-QFXaAtgH30aP1+/rNobntTAMfwh+AAb26FyZgElVdC4="; 78 }; 79 80 propagatedUserEnvPkgs = [ gtk-engine-murrine ]; 81 82 nativeBuildInputs = [ sassc ]; 83 buildInputs = [ gnome-themes-extra ]; 84 85 dontBuild = true; 86 87 passthru.updateScript = unstableGitUpdater { }; 88 89 postPatch = '' 90 patchShebangs themes/install.sh 91 ''; 92 93 installPhase = '' 94 runHook preInstall 95 mkdir -p $out/share/themes 96 cd themes 97 ./install.sh -n Gruvbox \ 98 ${lib.optionalString (colorVariants != [ ]) "-c " + toString colorVariants} \ 99 ${lib.optionalString (sizeVariants != [ ]) "-s " + toString sizeVariants} \ 100 ${lib.optionalString (themeVariants != [ ]) "-t " + toString themeVariants} \ 101 ${lib.optionalString (tweakVariants != [ ]) "--tweaks " + toString tweakVariants} \ 102 -d "$out/share/themes" 103 cd ../icons 104 ${lib.optionalString (iconVariants != [ ]) '' 105 mkdir -p $out/share/icons 106 cp -a ${toString (map (v: "Gruvbox-${v}") iconVariants)} $out/share/icons/ 107 ''} 108 runHook postInstall 109 ''; 110 111 meta = { 112 description = "GTK theme based on the Gruvbox colour palette"; 113 homepage = "https://github.com/Fausto-Korpsvart/Gruvbox-GTK-Theme"; 114 license = lib.licenses.gpl3Plus; 115 platforms = lib.platforms.unix; 116 maintainers = with lib.maintainers; [ 117 luftmensch-luftmensch 118 math-42 119 d3vil0p3r 120 ]; 121 }; 122 }