Scanners: Difference between revisions
imported>Fadenb m Syntaxhighlight |
imported>Symphorien add mention of epkowa |
||
| Line 1: | Line 1: | ||
== | Scanners are handled by the SANE library: | ||
<syntaxhighlight lang="nix">#/etc/nixos/configuration.nix | |||
{ | |||
hardware.sane.enable = true; | |||
}</syntaxhighlight> | |||
== Verification == | |||
To check quickly if your scanner is detected by SANE, you can use <code>scanimage -L</code>. If root only can detect the scanner, try adding your user in the <code>scanner</code> or <code>lp</code> group. | |||
== Extra backends == | |||
You can check on the [http://www.sane-project.org/sane-supported-devices.html official page of libsane] if your scanner is supported. Some backends are proprietary and not installed by default (see below). | |||
Note that the selection of the right set of backends by libsane depends on the <code>LD_LIBRARY_PATH</code> environment variable. <code>nixos-rebuild switch</code> is thus not enough to "install" a new backend, you need to logout/login again for changes to take effect. | |||
=== HP === | |||
<syntaxhighlight lang="nix">hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ];</syntaxhighlight> | |||
=== Epson === | |||
If your scanner is listed as supported by the epkowa backend : | |||
<syntaxhighlight lang="nix">hardware.sane.extraBackends = [ pkgs.epkowa ];</syntaxhighlight> | |||
=== SnapScan firmware === | |||
Many scanners require firmware blobs which can be downloaded from the website of the scanner or extracted from the drivers they provide. Once you have the appropriate firmware you need to tell SANE where to find it in your configuration.nix: | Many scanners require firmware blobs which can be downloaded from the website of the scanner or extracted from the drivers they provide. Once you have the appropriate firmware you need to tell SANE where to find it in your configuration.nix: | ||
| Line 10: | Line 37: | ||
sha256 = "00cv25v4xlrgp3di9bdfd07pffh9jq2j0hncmjv3c65m8bqhjglq"; | sha256 = "00cv25v4xlrgp3di9bdfd07pffh9jq2j0hncmjv3c65m8bqhjglq"; | ||
}; | }; | ||
}</syntaxhighlight> | |||
== Gimp plugin == | |||
To enable the Gimp plugin you need a special version of xsane : | |||
<syntaxhighlight lang="nix">{ | |||
nixpkgs.config.packageOverrides = pkgs: { | nixpkgs.config.packageOverrides = pkgs: { | ||
xsaneGimp = pkgs.xsane.override { gimpSupport = true; }; | xsaneGimp = pkgs.xsane.override { gimpSupport = true; }; | ||
}; | }; | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||
and you also need to manually create a symlink: | |||
<syntaxhighlight lang="bash">ln -s /run/current-system/sw/bin/xsane ~/.gimp-2.8/plug-ins/xsane</syntaxhighlight> | <syntaxhighlight lang="bash">ln -s /run/current-system/sw/bin/xsane ~/.gimp-2.8/plug-ins/xsane</syntaxhighlight> | ||
== Enable Network Scanning == | == Enable Network Scanning == | ||