diff --git a/yodaTab/configuration.nix b/yodaTab/configuration.nix index a27239e..97d3503 100644 --- a/yodaTab/configuration.nix +++ b/yodaTab/configuration.nix @@ -9,6 +9,7 @@ [ # Include the results of the hardware scan. ./hardware-configuration.nix ./home-manager.nix + ./print-and-scan.nix ]; # Bootloader. @@ -64,9 +65,6 @@ # Configure console keymap console.keyMap = "de-latin1-nodeadkeys"; - # Enable CUPS to print documents. - services.printing.enable = true; - # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; diff --git a/yodaTab/print-and-scan.nix b/yodaTab/print-and-scan.nix new file mode 100644 index 0000000..2a77376 --- /dev/null +++ b/yodaTab/print-and-scan.nix @@ -0,0 +1,31 @@ +{ config, pkgs, ... }: + +{ + # Printing with IPP everywhere capable printers + # https://nixos.wiki/wiki/Printing + + # Enable CUPS to print documents. + services.printing.enable = true; + # HP and Lexmark drivers + services.printing.drivers = [ pkgs.hplip pkgs.postscript-lexmark ]; + services.avahi.enable = true; + services.avahi.nssmdns = true; + # WiFi printers + services.avahi.openFirewall = true; + + # Scanning + # https://nixos.wiki/wiki/Scanners + # https://unix.stackexchange.com/questions/518687/how-do-i-set-up-scanning-from-an-hp-officejet-pro-on-nixos/518688 + hardware.sane = { + enable = true; + # Optionally, add pkgs.sane-airscan for AirScan. + extraBackends = [ pkgs.hplip ]; + }; + + users.users.yoda = { + extraGroups = [ "scanner" "lp" ]; + packages = with pkgs; [ + gnome.simple-scan + ]; + }; +}