Scanners: Difference between revisions

From NixOS Wiki
imported>Makefu
initial batch of nixos-users
 
imported>Fadenb
m Syntaxhighlight
Line 3: Line 3:
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:


<pre class="nix">{
<syntaxhighlight lang="nix">{
   hardware.sane.enable = true;
   hardware.sane.enable = true;
   nixpkgs.config.sane.snapscanFirmware = pkgs.fetchurl {
   nixpkgs.config.sane.snapscanFirmware = pkgs.fetchurl {
     # https://wiki.ubuntuusers.de/Scanner/Epson_Perfection/#Unterstuetzte-Geraete
     # https://wiki.ubuntuusers.de/Scanner/Epson_Perfection/#Unterstuetzte-Geraete
     url = &quot;https://media-cdn.ubuntu-de.org/wiki/attachments/52/46/Esfw41.bin&quot;; #Epson Perfection 2480
     url = "https://media-cdn.ubuntu-de.org/wiki/attachments/52/46/Esfw41.bin"; #Epson Perfection 2480
     sha256 = &quot;00cv25v4xlrgp3di9bdfd07pffh9jq2j0hncmjv3c65m8bqhjglq&quot;;
     sha256 = "00cv25v4xlrgp3di9bdfd07pffh9jq2j0hncmjv3c65m8bqhjglq";
   };
   };
   # to build the gimp plugin
   # to build the gimp plugin
Line 14: Line 14:
     xsaneGimp = pkgs.xsane.override { gimpSupport = true; };  
     xsaneGimp = pkgs.xsane.override { gimpSupport = true; };  
   };
   };
}</pre>
}</syntaxhighlight>
To enable the gimp plugin you also need to manually create a symlink:
To enable the gimp plugin you also need to manually create a symlink:


<pre>ln -s /run/current-system/sw/bin/xsane ~/.gimp-2.8/plug-ins/xsane</pre>
<syntaxhighlight lang="bash">ln -s /run/current-system/sw/bin/xsane ~/.gimp-2.8/plug-ins/xsane</syntaxhighlight>
== Support for HP scanners ==
== Support for HP scanners ==


<code>hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ];</code>
<syntaxhighlight lang="nix">hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ];</syntaxhighlight>


== Non-root scanning ==
== Non-root scanning ==
Line 30: Line 30:
As of right now ( 2017-08-16 ) the sane backend does not support overriding according to the [https://github.com/NixOS/nixpkgs/issues/17411 nixpkgs issue #17411]. The workaround for this is to download the [https://raw.githubusercontent.com/michalrus/dotfiles/d943be3089aa436e07cea5f22d829402936a9229/.nixos-config.symlink/modules/sane-extra-config.nix sane-extra-config.nix of michaelrus], put it into <code>/etc/nixos/sane-extra-config.nix</code> and use it in your <code>configuration.nix</code> via:
As of right now ( 2017-08-16 ) the sane backend does not support overriding according to the [https://github.com/NixOS/nixpkgs/issues/17411 nixpkgs issue #17411]. The workaround for this is to download the [https://raw.githubusercontent.com/michalrus/dotfiles/d943be3089aa436e07cea5f22d829402936a9229/.nixos-config.symlink/modules/sane-extra-config.nix sane-extra-config.nix of michaelrus], put it into <code>/etc/nixos/sane-extra-config.nix</code> and use it in your <code>configuration.nix</code> via:


<pre class="nix">{ ... }:{
<syntaxhighlight lang="nix">{ ... }:{
  imports = [
  imports = [
   ./sane-extra-config.nix
   ./sane-extra-config.nix
  ];
  ];
  ...
  ...
  hardware.sane.extraConfig.&quot;magicolor&quot; = ''
  hardware.sane.extraConfig."magicolor" = ''
   net 10.0.0.30 0x2098
   net 10.0.0.30 0x2098
  ''; # magicolor 1690mf
  ''; # magicolor 1690mf
}</pre>
}</syntaxhighlight>
== List of scanner firmware files ==
== List of scanner firmware files ==


* [https://sites.google.com/site/rameyarnaud/media/books/agfa-scanners-with-linux Agfa Snapscan e40]
* [https://sites.google.com/site/rameyarnaud/media/books/agfa-scanners-with-linux Agfa Snapscan e40]
* [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]

Revision as of 11:59, 27 August 2017

Add SANE 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:

{
  hardware.sane.enable = true;
  nixpkgs.config.sane.snapscanFirmware = pkgs.fetchurl {
    # https://wiki.ubuntuusers.de/Scanner/Epson_Perfection/#Unterstuetzte-Geraete
    url = "https://media-cdn.ubuntu-de.org/wiki/attachments/52/46/Esfw41.bin"; #Epson Perfection 2480
    sha256 = "00cv25v4xlrgp3di9bdfd07pffh9jq2j0hncmjv3c65m8bqhjglq";
  };
  # to build the gimp plugin
  nixpkgs.config.packageOverrides = pkgs: {
    xsaneGimp = pkgs.xsane.override { gimpSupport = true; }; 
  };
}

To enable the gimp plugin you also need to manually create a symlink:

ln -s /run/current-system/sw/bin/xsane ~/.gimp-2.8/plug-ins/xsane

Support for HP scanners

hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ];

Non-root scanning

It seems like you might need to add group scanner to users which should be allowed to use scanner.

Enable Network Scanning

As of right now ( 2017-08-16 ) the sane backend does not support overriding according to the nixpkgs issue #17411. The workaround for this is to download the sane-extra-config.nix of michaelrus, put it into /etc/nixos/sane-extra-config.nix and use it in your configuration.nix via:

{ ... }:{
 imports = [
  ./sane-extra-config.nix
 ];
 ...
 hardware.sane.extraConfig."magicolor" = ''
   net 10.0.0.30 0x2098
 ''; # magicolor 1690mf
}

List of scanner firmware files