[Nix-dev] printing on nix
Kirill Elagin
kirelagin at gmail.com
Tue Jun 20 09:09:01 CEST 2017
I’m not quite sure, but I always thought CUPS was searching for the filter
in the PATH:
https://github.com/NixOS/nixpkgs/blob/50fadc8b18fb3da6bda2f3710009a15f6ac45567/nixos/modules/services/printing/cupsd.nix#L79
I don’t think the NixOS module has a simple way to adjust PATH, but you
could try to put the filter into one of the mentioned directories.
Another option that should definitely work is to replace the filter name
with the absolute path in the ppd file itself.
On Tue, Jun 20, 2017 at 12:55 AM Nawal Husnoo <nawal at husnoo.com> wrote:
> Hi,
>
> I've got the default.nix below, and I run it using nix-shell. I opened
> firefox, and went to 127.0.0.1:631 and added a printer, and selected the
> ppd file from /opt/share/ppd/canonmp250.ppd.
>
> Unfortunately, when I try to print a test page I get the error message:
>
> Idle - "File
> "/nix/store/wy6c4mlp6zhjj4j3cjwrhwfi4ba9bxab-cups-progs/lib/cups/filter/pstocanonij"
> not available: No such file or directory"
>
> The file lives at /opt/lib/cups/filter/pstocanonij.
>
> How do I override cups path in nix?
>
> thanks,
>
> Nawal.
>
>
> { pkgs ? import <nixpkgs> {}}:
>
> (pkgs.buildFHSUserEnv {
> name = "simple-x11-env";
> targetPkgs = pkgs: (with pkgs; [
> udev
> alsaLib
> gtk2-x11
> patchelf
> binutils
> popt
> cups
> dpkg
> cairo
> pango
> fontconfig
> glib
> dpkg
> atk
> gdk_pixbuf
> libxml2
> libtiff
> firefox
> ]) ++ (with pkgs.xorg; [
> libX11
> libXcursor
> libXrandr
> libXext
> libXinerama
> libXrender
> libXi
> libXfixes
> ]);
> multiPkgs = pkgs: (with pkgs; [
> ]);
>
> extraBuildCommands = ''
> echo "instaling environment for cups printing with canon mp 250..."
>
> ls -lh $out/
> mkdir -p $out/opt/bin/
> mkdir -p $out/opt/lib/
> cp -r
> /home/nawal/data/nixos/user/pkgs/canon/tmp/cnijfilter-common/usr/bin/*
> $out/opt/bin/
> cp -r
> /home/nawal/data/nixos/user/pkgs/canon/tmp/cnijfilter-common/usr/share/*
> $out/opt/share/
> cp -r
> /home/nawal/data/nixos/user/pkgs/canon/tmp/cnijfilter-common/usr/lib/*
> $out/opt/lib/
>
> cp -r
> /home/nawal/data/nixos/user/pkgs/canon/tmp/cnijfilter-mp250series/usr/bin/*
> $out/opt/bin/
> cp -r
> /home/nawal/data/nixos/user/pkgs/canon/tmp/cnijfilter-mp250series/usr/share/*
> $out/opt/share/
> cp -r
> /home/nawal/data/nixos/user/pkgs/canon/tmp/cnijfilter-mp250series/usr/lib/*
> $out/opt/lib/
>
> ln -s $out/opt/lib/libcnbpcmcm356.so.8.0.1 $out/opt/lib/libcnbpcmcm356.so
> ln -s $out/opt/lib/libcnbpcnclbjcmd356.so.3.3.0
> $out/opt/lib/libcnbpcnclbjcmd356.so
> ln -s $out/opt/lib/libcnbpess356.so.3.3.3 $out/opt/lib/libcnbpess356.so
> ln -s $out/opt/lib/libcnnet.so.1.2.0 $out/opt/lib/libcnnet.so
> ln -s $out/opt/lib/libcnbpcnclapi356.so.3.5.0
> $out/opt/lib/libcnbpcnclapi356.so
> ln -s $out/opt/lib/libcnbpcnclui356.so.3.6.0
> $out/opt/lib/libcnbpcnclui356.so
> ln -s $out/opt/lib/libcnbpo356.so.1.0.2 $out/opt/lib/libcnbpo356.so
>
>
> echo "OUT=$out"
> '';
>
> profile = ''
> export LD_LIBRARY_PATH=$out/opt/lib:$LD_LIBRARY_PATH
> export PATH=$out/opt/bin:$PATH
> export TZDIR=/etc/zoneinfo
> '';
>
> runScript = ''
> bash
> '';
> }).env
>
>
> #${dpkg}/bin/dpkg -x ./debs/cnijfilter-common_3.40-1_amd64.deb
> tmp/cnijfilter-common
> #${dpkg}/bin/dpkg -x ./debs/cnijfilter-mp250series_3.40-1_amd64.deb
> tmp/cnijfilter-mp250series
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> https://mailman.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170620/d92dd1e4/attachment-0001.html>
More information about the nix-dev
mailing list