Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / fl / fluent-gtk-theme / package.nix
blob137f8a92dd1bccec5a1eae2c10fca38f06cda253
2   lib,
3   stdenvNoCC,
4   fetchFromGitHub,
5   gitUpdater,
6   gnome-themes-extra,
7   gtk-engine-murrine,
8   jdupes,
9   sassc,
10   themeVariants ? [ ], # default: blue
11   colorVariants ? [ ], # default: all
12   sizeVariants ? [ ], # default: standard
13   tweaks ? [ ],
16 let
17   pname = "fluent-gtk-theme";
19 lib.checkListOfEnum "${pname}: theme variants"
20   [
21     "default"
22     "purple"
23     "pink"
24     "red"
25     "orange"
26     "yellow"
27     "green"
28     "teal"
29     "grey"
30     "all"
31   ]
32   themeVariants
33   lib.checkListOfEnum
34   "${pname}: color variants"
35   [
36     "standard"
37     "light"
38     "dark"
39   ]
40   colorVariants
41   lib.checkListOfEnum
42   "${pname}: size variants"
43   [
44     "standard"
45     "compact"
46   ]
47   sizeVariants
48   lib.checkListOfEnum
49   "${pname}: tweaks"
50   [
51     "solid"
52     "float"
53     "round"
54     "blur"
55     "noborder"
56     "square"
57   ]
58   tweaks
60   stdenvNoCC.mkDerivation
61   (finalAttrs: {
62     inherit pname;
63     version = "2024-06-12";
65     src = fetchFromGitHub {
66       owner = "vinceliuice";
67       repo = "fluent-gtk-theme";
68       rev = finalAttrs.version;
69       hash = "sha256-ONhW68UUrFiv5hxkR7XI8U/5+qM+tYLIS2OM05pqJi0=";
70     };
72     nativeBuildInputs = [
73       jdupes
74       sassc
75     ];
77     buildInputs = [ gnome-themes-extra ];
79     propagatedUserEnvPkgs = [ gtk-engine-murrine ];
81     postPatch = ''
82       patchShebangs install.sh
83     '';
85     installPhase = ''
86       runHook preInstall
88       name= HOME="$TMPDIR" ./install.sh \
89         ${lib.optionalString (themeVariants != [ ]) "--theme " + builtins.toString themeVariants} \
90         ${lib.optionalString (colorVariants != [ ]) "--color " + builtins.toString colorVariants} \
91         ${lib.optionalString (sizeVariants != [ ]) "--size " + builtins.toString sizeVariants} \
92         ${lib.optionalString (tweaks != [ ]) "--tweaks " + builtins.toString tweaks} \
93         --icon nixos \
94         --dest $out/share/themes
96       jdupes --quiet --link-soft --recurse $out/share
98       runHook postInstall
99     '';
101     passthru.updateScript = gitUpdater { };
103     meta = {
104       description = "Fluent design gtk theme";
105       changelog = "https://github.com/vinceliuice/Fluent-gtk-theme/releases/tag/${finalAttrs.version}";
106       homepage = "https://github.com/vinceliuice/Fluent-gtk-theme";
107       license = lib.licenses.gpl3Only;
108       platforms = lib.platforms.unix;
109       maintainers = with lib.maintainers; [
110         luftmensch-luftmensch
111         romildo
112       ];
113     };
114   })