Scanners: Difference between revisions

imported>Skylark
m Copyedit (no changes in content) + remove duplication of Apple list
Add example for network-attached epkowa scanner
 
(5 intermediate revisions by 5 users not shown)
Line 48: Line 48:
</blockquote>
</blockquote>


To enable Apple AirScan/Microsoft WSD "driverless" scanning, use the <tt>sane-airscan</tt> drivers:
eSCL/Apple Airscan scanners should be found natively by the default escl backend. However, the <tt>sane-airscan</tt> third party backend is more actively maintained and you may have better luck using it:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
hardware.sane.extraBackends = [ pkgs.sane-airscan ];
hardware.sane.extraBackends = [ pkgs.sane-airscan ];
services.udev.packages = [ pkgs.sane-airscan ];
</syntaxhighlight>
</syntaxhighlight>
It can be that your scanner is found twice (once by <tt>escl</tt> and once by <tt>airscan</tt>, in this case disable <tt>escl</tt>:
<syntaxhighlight lang="nix">
hardware.sane.disabledDefaultBackends = [ "escl" ];
</syntaxhighlight>
To detect Microsoft WSD "driverless" scanning, also use the <tt>sane-airscan</tt> backend.


If the scanner is connected by USB, also set the following option:
If the scanner is connected by USB, also set the following option:
Line 64: Line 72:


===Epson===
===Epson===
If your scanner is listed as supported by the <tt>epkowa</tt> backend:
If your scanner is listed as supported by the <tt>epkowa</tt> backend and is connected by USB or SCSI:


<syntaxhighlight lang="nix">hardware.sane.extraBackends = [ pkgs.epkowa ];</syntaxhighlight>
<syntaxhighlight lang="nix">hardware.sane.extraBackends = [ pkgs.epkowa ];</syntaxhighlight>
If your scanner is listed as supported by the <tt>epkowa</tt> backend and is on the network,
substitute the host name or IP address in:
<syntaxhighlight lang="nix">
hardware.sane.extraBackends = [
  (pkgs.epkowa.overrideAttrs (oldAttrs: {
    postInstall = oldAttrs.postInstall + ''
      echo "net epson10a2e0.local" >> $out/etc/sane.d/epkowa.conf
    '';
  }))
];
</syntaxhighlight>


Some other scanners (see [https://gitlab.com/utsushi/utsushi/blob/master/README list]) need the <tt>utsushi</tt> backend:
Some other scanners (see [https://gitlab.com/utsushi/utsushi/blob/master/README list]) need the <tt>utsushi</tt> backend:
Line 124: Line 145:


<ol>
<ol>
<li>You need to install a special version of xsane, which you can enable by amending <tt>/etc/nixos/configuration.nix</tt> as follows:
<li>Enable GIMP support in xsane by editing <tt>/etc/nixos/configuration.nix.</tt> Remove <tt>pkgs.xsane</tt> from your package list, and use the following instead:


<syntaxhighlight lang="nix">{
<syntaxhighlight lang="nix">{
   ...
   #...
   nixpkgs.config.packageOverrides = pkgs: {
   environment.systemPackages = [
     xsaneGimp = pkgs.xsane.override { gimpSupport = true; };
     (pkgs.xsane.override { gimpSupport = true; })
   };
   ];
   ...
   #...
}</syntaxhighlight></li>
}</syntaxhighlight></li>
<li>Rebuild: <syntaxhighlight lang="console">$ sudo nixos-rebuild switch</syntaxhighlight></li>
<li>Rebuild: <syntaxhighlight lang="console">$ sudo nixos-rebuild switch</syntaxhighlight></li>
Line 140: Line 161:
==Network scanning==
==Network scanning==


If NixOs cannot find a scanner located on your network, you may be interested in adding in your <tt>configuration.nix</tt>:
If NixOS cannot find a scanner located on your network, you may be interested in adding in your <tt>configuration.nix</tt>:


<syntaxhighlight lang="nix">{
<syntaxhighlight lang="nix">{
Line 166: Line 187:


==Using the scanner button==
==Using the scanner button==
{{WOC}}
Many scanners feature a hardware button which makes for very convenient operation, especially in combination with an automated document processing system like <tt>paperless</tt>.  NixOS includes the scanner button daemon <tt>scanbd</tt> which can be used for this purpose; however, its setup isn't terribly user friendly.
Many scanners feature a hardware button which makes for very convenient operation, especially in combination with an automated document processing system like <tt>paperless</tt>.  NixOS includes the scanner button daemon <tt>scanbd</tt> which can be used for this purpose; however, its setup isn't terribly user friendly.


Line 358: Line 380:
       };
       };
}</syntaxhighlight>
}</syntaxhighlight>


==See also==
==See also==
Line 365: Line 386:
* [https://download.tuxfamily.org/xcfaudio/ Misc Agfa Snapscan] | [https://ipfs.io/ipfs/QmZJ2SfpfYUAS23TujhcdLpTox1SW3Dw3MoCej9GAfs4ya IPFS mirror]
* [https://download.tuxfamily.org/xcfaudio/ Misc Agfa Snapscan] | [https://ipfs.io/ipfs/QmZJ2SfpfYUAS23TujhcdLpTox1SW3Dw3MoCej9GAfs4ya IPFS mirror]


[[Category:Configuration]][[Category:Hardware]]
[[Category:Hardware]]