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
This commit is contained in:
Robert Helgesson 2020-06-04 19:45:22 +02:00
parent a21c97d011
commit 8e8210b441
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -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 \