summaryrefslogtreecommitdiff
path: root/pkgs/by-name/ma/matcha-gtk-theme/package.nix
blob: 61b923022bb76f25724d1047bd0470a1b739fa4f (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
  lib,
  stdenvNoCC,
  fetchFromGitHub,
  gdk-pixbuf,
  gtk-engine-murrine,
  jdupes,
  librsvg,
  gitUpdater,
  colorVariants ? [ ], # default: all
  themeVariants ? [ ], # default: blue
}:

let
  pname = "matcha-gtk-theme";

in
lib.checkListOfEnum "${pname}: color variants" [ "standard" "light" "dark" ] colorVariants
  lib.checkListOfEnum
  "${pname}: theme variants"
  [ "aliz" "azul" "sea" "pueril" "all" ]
  themeVariants

  stdenvNoCC.mkDerivation
  rec {
    inherit pname;
    version = "2025-04-11";

    src = fetchFromGitHub {
      owner = "vinceliuice";
      repo = pname;
      rev = version;
      sha256 = "sha256-vPAGEa3anWAynEg2AYme4qpHJdLDKk2CmL5iQ1mBYgM=";
    };

    nativeBuildInputs = [
      jdupes
    ];

    buildInputs = [
      gdk-pixbuf
      librsvg
    ];

    propagatedUserEnvPkgs = [
      gtk-engine-murrine
    ];

    postPatch = ''
      patchShebangs install.sh
    '';

    installPhase = ''
      runHook preInstall

      mkdir -p $out/share/themes

      name= ./install.sh \
        ${lib.optionalString (colorVariants != [ ]) "--color " + builtins.toString colorVariants} \
        ${lib.optionalString (themeVariants != [ ]) "--theme " + builtins.toString themeVariants} \
        --dest $out/share/themes

      mkdir -p $out/share/doc/${pname}
      cp -a src/extra/firefox $out/share/doc/${pname}

      jdupes --quiet --link-soft --recurse $out/share

      runHook postInstall
    '';

    passthru.updateScript = gitUpdater { };

    meta = with lib; {
      description = "Stylish flat Design theme for GTK based desktop environments";
      homepage = "https://vinceliuice.github.io/theme-matcha";
      license = licenses.gpl3Only;
      platforms = platforms.unix;
      maintainers = [ maintainers.romildo ];
    };
  }