nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenvNoCC
3, fetchFromGitHub
4, gdk-pixbuf
5, gtk-engine-murrine
6, jdupes
7, librsvg
8, gitUpdater
9, colorVariants ? [] # default: all
10, themeVariants ? [] # default: blue
11}:
12
13let
14 pname = "matcha-gtk-theme";
15
16in
17lib.checkListOfEnum "${pname}: color variants" [ "standard" "light" "dark" ] colorVariants
18lib.checkListOfEnum "${pname}: theme variants" [ "aliz" "azul" "sea" "pueril" "all" ] themeVariants
19
20stdenvNoCC.mkDerivation rec {
21 inherit pname;
22 version = "2023-04-03";
23
24 src = fetchFromGitHub {
25 owner = "vinceliuice";
26 repo = pname;
27 rev = version;
28 sha256 = "mr9X7p/H8H2QKZxAQC9j/8OLK4D3EnWLxriFlh16diE=";
29 };
30
31 nativeBuildInputs = [
32 jdupes
33 ];
34
35 buildInputs = [
36 gdk-pixbuf
37 librsvg
38 ];
39
40 propagatedUserEnvPkgs = [
41 gtk-engine-murrine
42 ];
43
44 postPatch = ''
45 patchShebangs install.sh
46 '';
47
48 installPhase = ''
49 runHook preInstall
50
51 mkdir -p $out/share/themes
52
53 name= ./install.sh \
54 ${lib.optionalString (colorVariants != []) "--color " + builtins.toString colorVariants} \
55 ${lib.optionalString (themeVariants != []) "--theme " + builtins.toString themeVariants} \
56 --dest $out/share/themes
57
58 mkdir -p $out/share/doc/${pname}
59 cp -a src/extra/firefox $out/share/doc/${pname}
60
61 jdupes --quiet --link-soft --recurse $out/share
62
63 runHook postInstall
64 '';
65
66 passthru.updateScript = gitUpdater { };
67
68 meta = with lib; {
69 description = "A stylish flat Design theme for GTK based desktop environments";
70 homepage = "https://vinceliuice.github.io/theme-matcha";
71 license = licenses.gpl3Only;
72 platforms = platforms.unix;
73 maintainers = [ maintainers.romildo ];
74 };
75}