1{ lib
2, stdenvNoCC
3, fetchFromGitHub
4, gnome-shell
5, gtk-engine-murrine
6, gtk_engines
7, jdupes
8, sassc
9, gitUpdater
10, themeVariants ? [] # default: doder (blue)
11, colorVariants ? [] # default: all
12, sizeVariants ? [] # default: standard
13, tweaks ? []
14}:
15
16let
17 pname = "vimix-gtk-themes";
18
19in
20lib.checkListOfEnum "${pname}: theme variants" [ "doder" "beryl" "ruby" "amethyst" "jade" "grey" "all" ] themeVariants
21lib.checkListOfEnum "${pname}: color variants" [ "standard" "light" "dark" ] colorVariants
22lib.checkListOfEnum "${pname}: size variants" [ "standard" "compact" "all" ] sizeVariants
23lib.checkListOfEnum "${pname}: tweaks" [ "flat" "grey" "mix" "translucent" ] tweaks
24
25stdenvNoCC.mkDerivation rec {
26 inherit pname;
27 version = "2024-04-20";
28
29 src = fetchFromGitHub {
30 owner = "vinceliuice";
31 repo = pname;
32 rev = version;
33 sha256 = "RbAdoix+UWKiLB+04YiPa0UwzO1fFLy56IG1MipmE+E=";
34 };
35
36 nativeBuildInputs = [
37 gnome-shell # needed to determine the gnome-shell version
38 jdupes
39 sassc
40 ];
41
42 buildInputs = [
43 gtk_engines
44 ];
45
46 propagatedUserEnvPkgs = [
47 gtk-engine-murrine
48 ];
49
50 postPatch = ''
51 patchShebangs install.sh
52 '';
53
54 installPhase = ''
55 runHook preInstall
56 mkdir -p $out/share/themes
57 name= HOME="$TMPDIR" ./install.sh \
58 ${lib.optionalString (themeVariants != []) "--theme " + builtins.toString themeVariants} \
59 ${lib.optionalString (colorVariants != []) "--color " + builtins.toString colorVariants} \
60 ${lib.optionalString (sizeVariants != []) "--size " + builtins.toString sizeVariants} \
61 ${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
62 --dest $out/share/themes
63 rm $out/share/themes/*/{AUTHORS,LICENSE}
64 jdupes --quiet --link-soft --recurse $out/share
65 runHook postInstall
66 '';
67
68 passthru.updateScript = gitUpdater { };
69
70 meta = with lib; {
71 description = "Flat Material Design theme for GTK based desktop environments";
72 homepage = "https://github.com/vinceliuice/vimix-gtk-themes";
73 license = licenses.gpl3Only;
74 platforms = platforms.unix;
75 maintainers = [ maintainers.romildo ];
76 };
77}