mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-12 19:46:20 +00:00
25 lines
541 B
Nix
25 lines
541 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;
|
|
services.avahi = {
|
|
enable = true;
|
|
nssmdns4 = true;
|
|
openFirewall = true;
|
|
};
|
|
users.users.${username}.extraGroups = [ "lp" "scanner" ];
|
|
};
|
|
}
|