In Calibre, when I try to view a PDF, instead of launching a viewer Calibre just attempts to re-import the file and I end up with two copies of the file in my library. Calibre has been doing this since I started using NixOS six months ago. Largely, I’ve just worked around it by going directly to the file on my filesystem.
Today, I finally fixed it on a whim. First, I launched calibre from the command line. When I tried to open a PDF file, I saw an error message about “evince” not being found. Interestingly, evince is in one of the paths that it listed, but whatever. The calibre derivation does not seem to accept any relevant parameters, so I opted to add evince to the buildInputs directive in calibre. And, since I learned how to use overlays a few months ago, I just added this to my overlays file:
calibre = super.calibre.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [ super.evince ];
});
This is all it takes to make calibre correctly launch evince with PDF files.
Here’s a link to the relevant line in my configuration repo: https://github.com/savannidgerinel/nix-shell/blob/ceea3b0098f2d92692d906fb088676ba164799e5/overlays.nix#L14