From 09f3b7cc6e58864fb1dc535a2142efbe678a6cdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 26 Apr 2020 13:23:27 +0100 Subject: [PATCH] define printer in nix --- nixos/common-hardware.nix | 13 +++++++++++++ nixos/common-services.nix | 5 ----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/nixos/common-hardware.nix b/nixos/common-hardware.nix index adc176a6..91057a26 100644 --- a/nixos/common-hardware.nix +++ b/nixos/common-hardware.nix @@ -26,6 +26,19 @@ ''; }; + services.printing = { + enable = true; + drivers = [ pkgs.epson-escpr pkgs.samsung-unified-linux-driver pkgs.splix ]; + }; + + hardware.printers.ensurePrinters = [{ + description = "Epson XP540"; + name = "epsonxp540"; + deviceUri = "ipp://epsonxp540.lan/ipp/print"; + model = "epson-inkjet-printer-escpr/Epson-XP-540_Series-epson-escpr-en.ppd"; + ppdOptions = { PageSize = "A4"; Duplex = "DuplexNoTumble"; }; + }]; + powerManagement.enable = (lib.mkForce true); powerManagement.cpuFreqGovernor = (lib.mkForce null); powerManagement.powertop.enable = true; diff --git a/nixos/common-services.nix b/nixos/common-services.nix index 474c377f..5f13a46d 100644 --- a/nixos/common-services.nix +++ b/nixos/common-services.nix @@ -25,11 +25,6 @@ clipmenu.enable = true; lorri.enable = true; - printing = { - enable = true; - drivers = [ pkgs.epson-escpr pkgs.samsung-unified-linux-driver pkgs.splix ]; - }; - avahi = { enable = true; nssmdns = true;