From ab911f44e6d2d1513187107288bda3b711718d17 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 (cherry picked from commit 8e8210b4412b2d4cf0487efdca2e3ef91c0eea5a) --- 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 32006e025..f41e3160f 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 \