diff --git a/hosts/common/optional/print-server.nix b/hosts/common/optional/print-server.nix new file mode 100644 index 0000000..0467140 --- /dev/null +++ b/hosts/common/optional/print-server.nix @@ -0,0 +1,46 @@ +{pkgs, ...}: { + networking.firewall = { + allowedTCPPorts = [631]; + allowedUDPPorts = [631]; + }; + + services = { + printing = { + enable = true; + drivers = [pkgs.hplip]; + browsing = true; + defaultShared = true; + listenAddresses = ["*:631"]; + allowFrom = ["all"]; + extraConf = '' + DefaultPaperSize A4 + ''; + }; + + avahi = { + enable = true; + nssmdns = true; + openFirewall = true; + publish = { + enable = true; + userServices = true; + }; + }; + }; + + hardware.printers = { + ensurePrinters = [ + { + name = "HP_Envy_6000"; + location = "Home"; + deviceUri = "usb://HP/ENVY%206000%20series?serial=TH0B93F08W&interface=1"; + # deviceUri = "usb://Dell/1250c%20Color%20Printer?serial=YNP023240"; + model = "HP/hp-deskjet_plus_6000_series.ppd.gz"; + ppdOptions = { + PageSize = "A4"; + }; + } + ]; + ensureDefaultPrinter = "HP_Envy_6000"; + }; +} diff --git a/hosts/common/optional/printing.nix b/hosts/common/optional/printing.nix index a534adc..178c5ce 100644 --- a/hosts/common/optional/printing.nix +++ b/hosts/common/optional/printing.nix @@ -29,7 +29,7 @@ in { { name = "HP_ENVY_6000"; description = "Network printer hosted on bob"; - location = "bob"; + location = "home"; deviceUri = "ipp://bob/printers/HP_ENVY_6000_series"; model = "everywhere"; ppdOptions = { diff --git a/hosts/merlin/default.nix b/hosts/merlin/default.nix index dae6cca..b8eb206 100644 --- a/hosts/merlin/default.nix +++ b/hosts/merlin/default.nix @@ -48,6 +48,7 @@ in { ../common/optional/docker.nix ../common/optional/nix-ld.nix ../common/optional/fileserver/nfs-server/homeshare.nix + ../common/optional/print-server.nix # Nixos containers ../common/optional/nixos-containers/docker.nix diff --git a/modules/nixos/nixosAutoUpgrade.nix b/modules/nixos/nixosAutoUpgrade.nix index 1c02fee..16c2842 100644 --- a/modules/nixos/nixosAutoUpgrade.nix +++ b/modules/nixos/nixosAutoUpgrade.nix @@ -28,6 +28,7 @@ in remote = lib.mkOption { type = lib.types.str; description = "Attempts build on remote host ."; + default = ""; }; onCalendar = lib.mkOption { default = "daily";