Discussion:
printing on nix
(too old to reply)
Nawal Husnoo
2017-06-19 21:54:11 UTC
Permalink
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
Kirill Elagin
2017-06-20 07:09:01 UTC
Permalink
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.
Post by Nawal Husnoo
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.
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.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
https://mailman.science.uu.nl/mailman/listinfo/nix-dev
Nawal Husnoo
2017-06-20 08:27:45 UTC
Permalink
Thanks for the suggestion! I'm now trying to get it to build as a proper
package so that cups can access it...
Post by Kirill Elagin
I’m not quite sure, but I always thought CUPS was searching for the filter
https://github.com/NixOS/nixpkgs/blob/50fadc8b18fb3da6bda2f3710009a1
5f6ac45567/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.
Post by Nawal Husnoo
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.
Idle - "File "/nix/store/wy6c4mlp6zhjj4j3cjwrhwfi4ba9bx
ab-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.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
https://mailman.science.uu.nl/mailman/listinfo/nix-dev
Loading...