summary refs log tree commit diff
path: root/pkgs/data/icons/nordzy-icon-theme/default.nix
blob: cbe06641bc64d51d7ca5dbc31c950ffbf7f301e2 (plain) (blame)
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
{ stdenvNoCC
, fetchFromGitHub
, lib
, gtk3
, jdupes
, nordzy-themes ? [ "all" ] # Override this to only install selected themes
}:

stdenvNoCC.mkDerivation rec {
  pname = "nordzy-icon-theme";
  version = "1.8.5";

  src = fetchFromGitHub {
    owner = "alvatip";
    repo = "Nordzy-icon";
    rev = version;
    sha256 = "sha256-ea5OBvZrwH5Wvd7aieI9x3S10E8qcyg99Mh9B5RHkjo=";
  };

  # In the post patch phase we should first make sure to patch shebangs.
  postPatch = ''
    patchShebangs install.sh
  '';

  nativeBuildInputs = [
    gtk3
    jdupes
  ];

  dontDropIconThemeCache = true;

  installPhase = ''
    runHook preInstall

    name= ./install.sh --dest $out/share/icons \
      ${lib.optionalString (nordzy-themes != []) (lib.strings.concatMapStrings (theme: "-t ${theme} ") nordzy-themes)}

    # Replace duplicate files with hardlinks to the first file in each
    # set of duplicates, reducing the installed size in about 87%
    jdupes -L -r $out/share

    runHook postInstall
  '';

  dontFixup = true;

  meta = with lib; {
    description = "Icon theme using the Nord color palette, based on WhiteSur and Numix icon themes";
    homepage = "https://github.com/alvatip/Nordzy-icon";
    license = licenses.gpl3Only;
    platforms = platforms.linux;
    maintainers = with maintainers; [ alexnortung ];
  };
}