diff --git a/hosts/voyager/default.nix b/hosts/voyager/default.nix index acf4cb0..7dafa3a 100644 --- a/hosts/voyager/default.nix +++ b/hosts/voyager/default.nix @@ -98,7 +98,10 @@ }; workstation = { - printing.enable = true; + printing = { + enable = true; + hplip.enable = true; + }; }; home-manager = { diff --git a/options/workstation/default.nix b/options/workstation/default.nix index 05c4c70..d47b613 100644 --- a/options/workstation/default.nix +++ b/options/workstation/default.nix @@ -11,6 +11,10 @@ in Also adds some drivers for common printers. ''; + + hplip.enable = mkEnableOption '' + HP printing support using hplip software. + ''; }; }; } diff --git a/system/roles/workstation/services/printing.nix b/system/roles/workstation/services/printing.nix index 9460c12..4f459f7 100644 --- a/system/roles/workstation/services/printing.nix +++ b/system/roles/workstation/services/printing.nix @@ -1,5 +1,5 @@ { pkgs, lib, config, ...}: let - inherit (lib) mkIf; + inherit (lib) mkIf optional; deviceType = config.myOptions.device.roles.type; acceptedTypes = ["laptop" "desktop"]; @@ -26,5 +26,8 @@ in { openFirewall = true; }; }; + + environment.systemPackages = optional cfg.hplip.enable pkgs.hplip; + myOptions.system.impermanence.home.extraDirectories = optional cfg.hplip.enable ".hplip"; }; }