mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-26 06:24:33 +00:00
Add scanner support
This commit is contained in:
parent
a91d121a83
commit
d20eba8a64
|
@ -1,11 +1,16 @@
|
||||||
{ pkgs, lib, config, ...}: let
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
inherit (lib) mkIf optional;
|
inherit (lib) mkIf optional;
|
||||||
deviceType = config.myOptions.device.roles.type;
|
deviceType = config.myOptions.device.roles.type;
|
||||||
acceptedTypes = ["laptop" "desktop"];
|
acceptedTypes = ["laptop" "desktop"];
|
||||||
|
|
||||||
cfg = config.myOptions.workstation.printing;
|
cfg = config.myOptions.workstation.printing;
|
||||||
|
cfgUser = config.myOptions.system.username;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
config = mkIf (builtins.elem deviceType acceptedTypes && cfg.enable) {
|
config = mkIf (builtins.elem deviceType acceptedTypes && cfg.enable) {
|
||||||
# enable cups and add some drivers for common printers
|
# enable cups and add some drivers for common printers
|
||||||
services = {
|
services = {
|
||||||
|
@ -29,5 +34,11 @@ in {
|
||||||
|
|
||||||
environment.systemPackages = optional cfg.hplip.enable pkgs.hplip;
|
environment.systemPackages = optional cfg.hplip.enable pkgs.hplip;
|
||||||
myOptions.system.impermanence.home.extraDirectories = optional cfg.hplip.enable ".hplip";
|
myOptions.system.impermanence.home.extraDirectories = optional cfg.hplip.enable ".hplip";
|
||||||
|
|
||||||
|
# Support for SANE (Scanner Access Now Easy) scanners
|
||||||
|
hardware.sane.enable = true;
|
||||||
|
|
||||||
|
users.extraGroups.scanner.members = ["${cfgUser}"];
|
||||||
|
users.extraGroups.lp.members = ["${cfgUser}"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue