mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-12 11:36:20 +00:00
refactor: make the whole thing more generic
This commit is contained in:
23
modules/nixos/services/airprint.nix
Normal file
23
modules/nixos/services/airprint.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user