mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-11 02:56:27 +00:00
38 lines
609 B
Nix
38 lines
609 B
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
username,
|
|
...
|
|
}:
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.airprint;
|
|
in
|
|
{
|
|
options.services.airprint = {
|
|
enable = mkEnableOption "Enable printing over the air using sane and avahi";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
hardware.sane = {
|
|
enable = true;
|
|
extraBackends = [ pkgs.sane-airscan ];
|
|
};
|
|
services.printing = {
|
|
enable = true;
|
|
stateless = true;
|
|
};
|
|
services.avahi = {
|
|
enable = true;
|
|
nssmdns4 = true;
|
|
openFirewall = true;
|
|
};
|
|
users.users.${username}.extraGroups = [
|
|
"lp"
|
|
"scanner"
|
|
];
|
|
};
|
|
}
|