mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
sane: use mkSaneConfig to set system environment
This commit is contained in:
parent
4fb9c3700a
commit
8df521bf0f
@ -5,6 +5,8 @@ with lib;
|
||||
let
|
||||
|
||||
pkg = if config.hardware.sane.snapshot then pkgs.saneBackendsGit else pkgs.saneBackends;
|
||||
backends = [ pkg ] ++ config.hardware.sane.extraBackends;
|
||||
saneConfig = pkgs.mkSaneConfig { paths = backends; };
|
||||
|
||||
in
|
||||
|
||||
@ -26,6 +28,12 @@ in
|
||||
description = "Use a development snapshot of SANE scanner drivers.";
|
||||
};
|
||||
|
||||
hardware.sane.extraBackends = mkOption {
|
||||
type = types.listOf types.path;
|
||||
default = [];
|
||||
description = "Packages providing extra SANE backends to enable.";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -33,8 +41,12 @@ in
|
||||
|
||||
config = mkIf config.hardware.sane.enable {
|
||||
|
||||
environment.systemPackages = [ pkg ];
|
||||
services.udev.packages = [ pkg ];
|
||||
environment.systemPackages = backends;
|
||||
environment.variables = {
|
||||
SANE_CONFIG_DIR = "${saneConfig}/etc/sane.d";
|
||||
LD_LIBRARY_PATH = [ "${saneConfig}/lib/sane" ];
|
||||
};
|
||||
services.udev.packages = backends;
|
||||
|
||||
users.extraGroups."scanner".gid = config.ids.gids.scanner;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user