evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / ma / matrix-gtk-theme / package.nix
blob00a3f052847e2a48f1626e6e186c1b162a1e3c90
2   lib,
3   stdenvNoCC,
4   fetchFromGitHub,
5   gnome-shell,
6   sassc,
7   gnome-themes-extra,
8   gtk-engine-murrine,
9   unstableGitUpdater,
10   colorVariants ? [ ],
11   sizeVariants ? [ ],
12   themeVariants ? [ ],
13   tweakVariants ? [ ],
14   iconVariants ? [ ],
17 let
18   pname = "matrix-gtk-theme";
19   colorVariantList = [
20     "dark"
21     "light"
22   ];
23   sizeVariantList = [
24     "compact"
25     "standard"
26   ];
27   themeVariantList = [
28     "default"
29     "green"
30     "grey"
31     "orange"
32     "pink"
33     "purple"
34     "red"
35     "teal"
36     "yellow"
37     "all"
38   ];
39   tweakVariantList = [
40     "neo"
41     "trinity"
42     "black"
43     "float"
44     "outline"
45     "macos"
46   ];
47   iconVariantList = [
48     "Dark"
49     "Light"
50     "Sweet"
51   ];
53 lib.checkListOfEnum "${pname}: colorVariants" colorVariantList colorVariants lib.checkListOfEnum
54   "${pname}: sizeVariants"
55   sizeVariantList
56   sizeVariants
57   lib.checkListOfEnum
58   "${pname}: themeVariants"
59   themeVariantList
60   themeVariants
61   lib.checkListOfEnum
62   "${pname}: tweakVariants"
63   tweakVariantList
64   tweakVariants
65   lib.checkListOfEnum
66   "${pname}: iconVariants"
67   iconVariantList
68   iconVariants
70   stdenvNoCC.mkDerivation
71   {
72     inherit pname;
73     version = "0-unstable-2024-11-06";
75     src = fetchFromGitHub {
76       owner = "D3vil0p3r";
77       repo = "Matrix-GTK-Theme";
78       rev = "a91254e5827f5fb331308ecf893881bc9643f01a";
79       hash = "sha256-XiXKzXzzWcJIfEV8ngczovyjCqH7uX8tToihq66q+jo=";
80     };
82     propagatedUserEnvPkgs = [ gtk-engine-murrine ];
84     nativeBuildInputs = [
85       gnome-shell
86       sassc
87     ];
88     buildInputs = [ gnome-themes-extra ];
90     dontBuild = true;
92     passthru.updateScript = unstableGitUpdater { };
94     postPatch = ''
95       patchShebangs themes/install.sh
96     '';
98     installPhase = ''
99       runHook preInstall
100       mkdir -p $out/share/themes
101       cd themes
102       ./install.sh -n Matrix \
103       ${lib.optionalString (colorVariants != [ ]) "-c " + toString colorVariants} \
104       ${lib.optionalString (sizeVariants != [ ]) "-s " + toString sizeVariants} \
105       ${lib.optionalString (themeVariants != [ ]) "-t " + toString themeVariants} \
106       ${lib.optionalString (tweakVariants != [ ]) "--tweaks " + toString tweakVariants} \
107       -d "$out/share/themes"
108       cd ../icons
109       ${lib.optionalString (iconVariants != [ ]) ''
110         mkdir -p $out/share/icons
111         cp -a ${toString (map (v: "Matrix-${v}") iconVariants)} $out/share/icons/
112       ''}
113       runHook postInstall
114     '';
116     meta = {
117       description = "GTK theme based on the Matrix colour palette";
118       homepage = "https://github.com/D3vil0p3r/Matrix-GTK-Theme";
119       license = lib.licenses.gpl3Plus;
120       maintainers = with lib.maintainers; [ d3vil0p3r ];
121       platforms = lib.platforms.unix;
122     };
123   }