this post was submitted on 18 Nov 2023
1 points (100.0% liked)

Nix

10 readers
1 users here now

founded 1 year ago
MODERATORS
 

I'd like to add 'ImageMagick' as a dependency for ranger to enable sixel support for image preview. How do I go about doing this?

top 3 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 11 months ago

If you just need to make sure ImageMagick is available when ranger is built and/or run, you should be able to use overrideAttrs on the ranger package to add a buildInputs attribute, which will be a list containing the nix package for ImageMagick. To begin with, check this out:

https://ryantm.github.io/nixpkgs/using/overrides/

[–] [email protected] 1 points 11 months ago (1 children)

https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/applications/file-managers/ranger/default.nix#L53

You’ll have to modify this file in order to do what you want, then import it into your config, unless somebody already did this for you as a flake or something. I’d give a more thorough explanation but I’m at work atm. Hopefully you can understand from the file what you need to do or someone else can explain.

[–] [email protected] 1 points 11 months ago

I figured the need for imagemagick as a dependency while looking through this link before, but I was hoping there was an "easier" way to do this. Maybe I'll take this opportunity and make a PR when I have time, appreciate you. Thank you!!