Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use $XDG_DATA_DIRS to find the freedesktop.org.xml #160

Open
toastal opened this issue Apr 6, 2021 · 3 comments · May be fixed by #163
Open

Use $XDG_DATA_DIRS to find the freedesktop.org.xml #160

toastal opened this issue Apr 6, 2021 · 3 comments · May be fixed by #163

Comments

@toastal
Copy link

toastal commented Apr 6, 2021

I'm on NixOS and while I'm used to stuff breaking by now, the $XDG_DATA_DIRS is a standard for finding these types of directories. Included in my list for $XDG_DATA_DIRS is

$ ls ~/.nix-profile/share/mime/packages/                                              
freedesktop.org.xml  hugin.xml
$ ls /run/current-system/sw/share/mime/packages/                                      
freedesktop.org.xml
$ ls /nix/store/c20brs4h56nx8wp6ky86yh5pbhck2j6d-shared-mime-info-1.13.1/share/mime/packages/
freedesktop.org.xml

which all show that I have this file on my system.

The project is literally called xdg/shared-mime-info.

@toastal
Copy link
Author

toastal commented Apr 6, 2021

If it helps anyone as a workaround using Nix with Ruby in a nix-shell, you can add this

# shell.nix
{ pkgs }:

pkgs.mkShell {
  nativeBuildInputs = with pkgs.buildPackages; [
    ruby_2_7
    bundler
  ];

  FREEDESKTOP_MIME_TYPES_PATH = "${pkgs.shared_mime_info}/share/mime/packages/freedesktop.org.xml";
}

Which will provide the environment variable to the shell so bundler can install and use mimemagic from a Gemfile.

@bobvanderlinden
Copy link

Ran into this as well and found this issue. Thanks a lot for the suggestion. Using XDG_DATA_DIRS seems like a good practice for mimemagic to follow.

@bobvanderlinden bobvanderlinden linked a pull request Jun 7, 2021 that will close this issue
@bobvanderlinden
Copy link

Made a PR: #163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants