about summary refs log tree commit diff
path: root/pkgs/data
diff options
context:
space:
mode:
authorLuca Bruno <lethalman88@gmail.com>2015-02-24 10:51:46 +0100
committerPeter Simons <simons@cryp.to>2015-03-09 15:55:24 +0100
commitaae9e49cbc0c8211532cb43c03cd73a97079a2bc (patch)
treebc6c91367461b1b1e3fb43087d0b14dd69a593b7 /pkgs/data
parentf43d759bc410de0f04523c8f13979e529794ddbd (diff)
Add setup-hook to hicolor_icon_theme
Diffstat (limited to 'pkgs/data')
-rw-r--r--pkgs/data/icons/hicolor-icon-theme/default.nix2
-rw-r--r--pkgs/data/icons/hicolor-icon-theme/setup-hook.sh20
2 files changed, 22 insertions, 0 deletions
diff --git a/pkgs/data/icons/hicolor-icon-theme/default.nix b/pkgs/data/icons/hicolor-icon-theme/default.nix
index 1cf29db9dbc65..f8eb7bc032eaf 100644
--- a/pkgs/data/icons/hicolor-icon-theme/default.nix
+++ b/pkgs/data/icons/hicolor-icon-theme/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "01ilkizzal3wq2naaj84rqmd850aari1ahiw9vfis3a82n4h72x3";
   };
 
+  setupHook = ./setup-hook.sh;
+
   meta = {
     description = "Default fallback theme used by implementations of the icon theme specification";
     homepage = http://icon-theme.freedesktop.org/releases/;
diff --git a/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh b/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh
new file mode 100644
index 0000000000000..05ab9b3d65df1
--- /dev/null
+++ b/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh
@@ -0,0 +1,20 @@
+# Populate XDG_ICON_DIRS
+hicolorIconThemeHook() {
+
+    # where to find icon themes
+    if [ -d "$1/share/icons" ]; then
+      addToSearchPath XDG_ICON_DIRS $1/share
+    fi
+	
+}
+
+envHooks+=(hicolorIconThemeHook)
+
+# Remove icon cache
+hicolorPreFixupPhase() {
+    rm -f $out/share/icons/hicolor/icon-theme.cache
+    rm -f $out/share/icons/HighContrast/icon-theme.cache
+}
+
+preFixupPhases="$preFixupPhases hicolorPreFixupPhase"
+