31 lines
452 B
Nix
31 lines
452 B
Nix
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
namespace,
|
|
...
|
|
}:
|
|
with lib;
|
|
with lib.${namespace};
|
|
let
|
|
cfg = config.${namespace}.services.printer;
|
|
in
|
|
{
|
|
options.${namespace}.services.printer = {
|
|
enable = mkBoolOpt false "Printer";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.printing = {
|
|
enable = true;
|
|
drivers = [ pkgs.hplip ];
|
|
};
|
|
|
|
services.avahi = {
|
|
enable = true;
|
|
nssmdns4 = true;
|
|
openFirewall = true;
|
|
};
|
|
};
|
|
|
|
}
|