summary refs log tree commit diff
path: root/nixos/modules/config/xdg
diff options
context:
space:
mode:
authorMichael Peyton Jones <me@michaelpj.com>2018-08-15 10:59:44 +0100
committerMichael Peyton Jones <me@michaelpj.com>2018-08-16 21:23:34 +0100
commit1b11fdd0df2254a762a16d04e603ba99e42169c0 (patch)
tree46695718d533092fb986a0a73d8260b1da306ec2 /nixos/modules/config/xdg
parent13e2e19158bcd2b4d53e452d82f62817194100ef (diff)
downloadnixpkgs-1b11fdd0df2254a762a16d04e603ba99e42169c0.tar
nixpkgs-1b11fdd0df2254a762a16d04e603ba99e42169c0.tar.gz
nixpkgs-1b11fdd0df2254a762a16d04e603ba99e42169c0.tar.bz2
nixpkgs-1b11fdd0df2254a762a16d04e603ba99e42169c0.tar.lz
nixpkgs-1b11fdd0df2254a762a16d04e603ba99e42169c0.tar.xz
nixpkgs-1b11fdd0df2254a762a16d04e603ba99e42169c0.tar.zst
nixpkgs-1b11fdd0df2254a762a16d04e603ba99e42169c0.zip
system-path: allow other modules to provide setup fragments
Diffstat (limited to 'nixos/modules/config/xdg')
-rw-r--r--nixos/modules/config/xdg/mime.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/nixos/modules/config/xdg/mime.nix b/nixos/modules/config/xdg/mime.nix
index db3e7c6d4c5..f1b672234a3 100644
--- a/nixos/modules/config/xdg/mime.nix
+++ b/nixos/modules/config/xdg/mime.nix
@@ -21,6 +21,16 @@ with lib;
       # this package also installs some useful data, as well as its utilities 
       pkgs.shared-mime-info 
     ];
+
+    environment.extraSetup = ''
+      if [ -w $out/share/mime ]; then
+        XDG_DATA_DIRS=$out/share ${pkgs.shared-mime-info}/bin/update-mime-database -V $out/share/mime > /dev/null
+      fi
+
+      if [ -w $out/share/applications ]; then
+        ${pkgs.desktop-file-utils}/bin/update-desktop-database $out/share/applications
+      fi
+    '';
   };
 
 }