Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, stdenv
3, fetchFromGitHub
4, gdk-pixbuf
5, gtk-engine-murrine
6, jdupes
7, librsvg
8, libxml2
9, buttonVariants ? [] # default to all
10, colorVariants ? [] # default to all
11, opacityVariants ? [] # default to all
12, sizeVariants ? [] # default to all
13}:
14
15let
16 pname = "sierra-gtk-theme";
17in
18lib.checkListOfEnum "${pname}: button variants" [ "standard" "alt" ] buttonVariants
19lib.checkListOfEnum "${pname}: color variants" [ "light" "dark" ] colorVariants
20lib.checkListOfEnum "${pname}: opacity variants" [ "standard" "solid" ] opacityVariants
21lib.checkListOfEnum "${pname}: size variants" [ "standard" "compact" ] sizeVariants
22
23stdenv.mkDerivation {
24 inherit pname;
25 version = "unstable-2021-05-24";
26
27 src = fetchFromGitHub {
28 owner = "vinceliuice";
29 repo = pname;
30 rev = "05899001c4fc2fec87c4d222cb3997c414e0affd";
31 sha256 = "174l5mryc34ma1r42pk6572c6i9hmzr9vj1a6w06nqz5qcfm1hds";
32 };
33
34 nativeBuildInputs = [
35 jdupes
36 libxml2
37 ];
38
39 buildInputs = [
40 gdk-pixbuf
41 librsvg
42 ];
43
44 propagatedUserEnvPkgs = [
45 gtk-engine-murrine
46 ];
47
48 installPhase = ''
49 runHook preInstall
50
51 patchShebangs install.sh
52
53 mkdir -p $out/share/themes
54 name= ./install.sh --dest $out/share/themes \
55 ${lib.optionalString (buttonVariants != []) "--alt " + builtins.toString buttonVariants} \
56 ${lib.optionalString (colorVariants != []) "--color " + builtins.toString colorVariants} \
57 ${lib.optionalString (opacityVariants != []) "--opacity " + builtins.toString opacityVariants} \
58 ${lib.optionalString (sizeVariants != []) "--flat " + builtins.toString sizeVariants}
59
60 # Replace duplicate files with hardlinks to the first file in each
61 # set of duplicates, reducing the installed size in about 79%
62 jdupes -L -r $out/share
63
64 runHook postInstall
65 '';
66
67 meta = with lib; {
68 description = "A Mac OSX like theme for GTK based desktop environments";
69 homepage = "https://github.com/vinceliuice/Sierra-gtk-theme";
70 license = licenses.gpl3;
71 platforms = platforms.unix;
72 maintainers = [ maintainers.romildo ];
73 };
74}