mastodon: 4.3.1 -> 4.3.2 (#361487)
[NixPkgs.git] / pkgs / by-name / to / tokyonight-gtk-theme / package.nix
blob346b4d69a03d90f21299aacd08fb7f88dc2003d4
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 = "tokyonight-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     "moon"
41     "storm"
42     "black"
43     "float"
44     "outline"
45     "macos"
46   ];
47   iconVariantList = [
48     "Dark-Cyan"
49     "Dark"
50     "Light"
51     "Moon"
52   ];
54 lib.checkListOfEnum "${pname}: colorVariants" colorVariantList colorVariants lib.checkListOfEnum
55   "${pname}: sizeVariants"
56   sizeVariantList
57   sizeVariants
58   lib.checkListOfEnum
59   "${pname}: themeVariants"
60   themeVariantList
61   themeVariants
62   lib.checkListOfEnum
63   "${pname}: tweakVariants"
64   tweakVariantList
65   tweakVariants
66   lib.checkListOfEnum
67   "${pname}: iconVariants"
68   iconVariantList
69   iconVariants
71   stdenvNoCC.mkDerivation
72   {
73     inherit pname;
74     version = "0-unstable-2024-11-06";
76     src = fetchFromGitHub {
77       owner = "Fausto-Korpsvart";
78       repo = "Tokyonight-GTK-Theme";
79       rev = "4dc45d60bf35f50ebd9ee41f16ab63783f80dd64";
80       hash = "sha256-AKZA+WCcfxDeNrNrq3XYw+SFoWd1VV2T9+CwK2y6+jA=";
81     };
83     propagatedUserEnvPkgs = [ gtk-engine-murrine ];
85     nativeBuildInputs = [
86       gnome-shell
87       sassc
88     ];
89     buildInputs = [ gnome-themes-extra ];
91     dontBuild = true;
93     passthru.updateScript = unstableGitUpdater { };
95     postPatch = ''
96       patchShebangs themes/install.sh
97     '';
99     installPhase = ''
100       runHook preInstall
101       mkdir -p $out/share/themes
102       cd themes
103       ./install.sh -n Tokyonight \
104       ${lib.optionalString (colorVariants != [ ]) "-c " + toString colorVariants} \
105       ${lib.optionalString (sizeVariants != [ ]) "-s " + toString sizeVariants} \
106       ${lib.optionalString (themeVariants != [ ]) "-t " + toString themeVariants} \
107       ${lib.optionalString (tweakVariants != [ ]) "--tweaks " + toString tweakVariants} \
108       -d "$out/share/themes"
109       cd ../icons
110       ${lib.optionalString (iconVariants != [ ]) ''
111         mkdir -p $out/share/icons
112         cp -a ${toString (map (v: "Tokyonight-${v}") iconVariants)} $out/share/icons/
113       ''}
114       runHook postInstall
115     '';
117     meta = {
118       description = "GTK theme based on the Tokyo Night colour palette";
119       homepage = "https://github.com/Fausto-Korpsvart/Tokyonight-GTK-Theme";
120       license = lib.licenses.gpl3Plus;
121       maintainers = with lib.maintainers; [
122         garaiza-93
123         Madouura
124         d3vil0p3r
125       ];
126       platforms = lib.platforms.unix;
127     };
128   }