With imagemagick installed in the NixOS unstable, convertion from PDF to PNG (or other image formats) fails because gs cannot be found:
$ convert /tmp/a.pdf /tmp/b.png
convert: no images defined `/tmp/b.png' @ error/convert.c/ConvertImageCommand/3252.
$ locate -r bin/gs$
/nix/store/45iygd09ig723zczx4ys0mxr03sgfg4i-ghostscript-9.18/bin/gs
/nix/store/c0q1dq2ahhsig95a9c5gwis29rzwmzg3-cups-progs/bin/gs
$ export PATH=/nix/store/45iygd09ig723zczx4ys0mxr03sgfg4i-ghostscript-9.18/bin:$PATH
$ convert /tmp/a.pdf /tmp/b.png
$ ls /tmp/b.png
/tmp/b.png
Probably imagemagick needs a propagated runtime dependency on ghostscript.
nixos-version, Ubuntu/Fedora: lsb_release -a, ...)16.09pre85639.453086a (Flounder)nix-env --version)nix-env (Nix) 1.11.2nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion)"16.09pre85639.453086a"cc @the-kenny @wkennington
Do we really want to pull ghostscript into the closure for imagemagick? It's a pretty big dependency.
Workaround: Install ghostscript to your system or your profile manually.
Doesn't imagemagicBig have ghostscript?
Right, it has.
imagemagickBig is not in the binary cache, right?
It should be. It's even used as dependency for ikiwiki.
For some reason imagemagick is being compiled from source on my unstable system (x86_64-linux) when I add imamagickBig on environment.systemPackages. I expected it to be fetched from the binary cache.
# nixos-version
16.09pre85639.453086a (Flounder)
# nixos-rebuild switch 2>&1 | tee /var/tmp/nix-rebuild.log
building Nix...
building the system configuration...
these derivations will be built:
/nix/store/czvm39vhzimsds7h69zmvnkpyi6byzzl-imagemagick-6.9.3-9.drv
/nix/store/xw7rj6ydbggr27bc3lbkb2gblj4pcqms-system-path.drv
/nix/store/m51dfadnz79fhapiawb3771nqk4gh812-xsession.drv
/nix/store/lvdjxxjvcs8m9nxlwfs3bwc4sn3lqacs-desktops.drv
/nix/store/1m4fjn6cyacci0s4ir3spd2xzh03w7s7-lightdm.conf.drv
/nix/store/ylgjgvkp50qbysa78zv0bx5j8mjrddw0-dbus-conf.drv
/nix/store/xzqq8hppp5smqy85cy7pzgkwmypwmfwc-unit-dbus.service.drv
/nix/store/ymrs9va8siz5p7dh192mvc3kraw3hcg0-unit-polkit.service.drv
/nix/store/xag3l95j6z49m2q5fp67ykha5mzjh70m-system-units.drv
/nix/store/fdkjvwingy8p6fsqwnfi86xcq45szkbq-unit-emacs.service.drv
/nix/store/xsrixq1656h4mzx51i0ab097jmvfmddx-user-units.drv
/nix/store/asp2ldc15c7lam00b5456clyp5vpjzgf-etc.drv
/nix/store/a5i2ykj8dsg3lm0jxv25xf4ww1d3x4cc-nixos-system-jrm.no-ip.org-16.09pre85639.453086a.drv
these paths will be fetched (8.38 MiB download, 8.40 MiB unpacked):
/nix/store/fz049636n3zak05c6jwdvz135iy2w2r4-ImageMagick-6.9.3-9.tar.xz
/nix/store/x8zsjkxzi6xy3vyasfy93zl7c4g2kbyl-stage-2-init.sh
/nix/store/zwcvckg82fc7spbjnip73pynxr5pz5xc-stdenv
fetching path ‘/nix/store/x8zsjkxzi6xy3vyasfy93zl7c4g2kbyl-stage-2-init.sh’...
fetching path ‘/nix/store/zwcvckg82fc7spbjnip73pynxr5pz5xc-stdenv’...
fetching path ‘/nix/store/fz049636n3zak05c6jwdvz135iy2w2r4-ImageMagick-6.9.3-9.tar.xz’...
[...]
building path(s) ‘/nix/store/f1ys84ax50sc7zfc48i3p3jpipl7fwf1-imagemagick-6.9.3-9-dev’, ‘/nix/store/psgzqab3bspd00swj3ls996j2yxlah47-imagemagick-6.9.3-9’, ‘/nix/store/rda3ylzgkkqzdcdzjjh4y0diz6zf5dfd-imagemagick-6.9.3-9-doc’
unpacking sources
[...]
$ find /nix/store -maxdepth 1 -ls | grep -vE '\.drv|tar.xz$' | grep --color -i imagemagick
2660 4 dr-xr-xr-x 3 root root 4096 Dec 31 1969 /nix/store/rda3ylzgkkqzdcdzjjh4y0diz6zf5dfd-imagemagick-6.9.3-9-doc
4498 4 dr-xr-xr-x 6 root root 4096 Dec 31 1969 /nix/store/f1ys84ax50sc7zfc48i3p3jpipl7fwf1-imagemagick-6.9.3-9-dev
762 4 dr-xr-xr-x 6 root root 4096 Dec 31 1969 /nix/store/psgzqab3bspd00swj3ls996j2yxlah47-imagemagick-6.9.3-9
@vcunat _Edited to show the output of nixos-rebuild_.
With current nixos-unstable (453086a), all outputs get fetched OK on my computer (x86_64-linux). /nix/store/pl7dbl8d38lv7pxc7sfcdn08md9dn943-imagemagick-6.9.3-9 in particular, to check hashes.
Since there is imagemagickBig, I’ll close.
Most helpful comment
Doesn't
imagemagicBighaveghostscript?