2011-12-05 18:32:45 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
hardware.sane.enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Enable support for SANE scanners.";
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.sane.snapshot = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Use a development snapshot of SANE scanner drivers.";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = let pkg = if config.hardware.sane.snapshot
|
2012-11-26 16:19:45 +01:00
|
|
|
then pkgs.saneBackendsGit
|
2011-12-05 18:32:45 +01:00
|
|
|
else pkgs.saneBackends;
|
|
|
|
in mkIf config.hardware.sane.enable {
|
|
|
|
environment.systemPackages = [ pkg ];
|
|
|
|
services.udev.packages = [ pkg ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|