From 8e8210b4412b2d4cf0487efdca2e3ef91c0eea5a Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 4 Jun 2020 19:45:22 +0200 Subject: [PATCH] xdg-mime: fix issue on WSL1 This change stops update-mime-database from running unless the `share/mime/packages` directory is writable. For some reason it appears to be read-only on WSL1. Fixes #1192 --- modules/misc/xdg-mime.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/misc/xdg-mime.nix b/modules/misc/xdg-mime.nix index 32006e02..f41e3160 100644 --- a/modules/misc/xdg-mime.nix +++ b/modules/misc/xdg-mime.nix @@ -30,7 +30,7 @@ in { ]; home.extraProfileCommands = '' - if [[ -w $out/share/mime && -d $out/share/mime/packages ]]; then + if [[ -w $out/share/mime && -w $out/share/mime/packages && -d $out/share/mime/packages ]]; then XDG_DATA_DIRS=$out/share \ PKGSYSTEM_ENABLE_FSYNC=0 \ ${pkgs.buildPackages.shared-mime-info}/bin/update-mime-database \