From 2cc8d156532aa776c53307375acafb80a4a3cfd3 Mon Sep 17 00:00:00 2001 From: Jascha Geerds Date: Mon, 4 May 2015 22:32:35 +0200 Subject: cups: Add defaultShared, browsing and webInterace config option --- nixos/modules/services/printing/cupsd.nix | 30 +++++++++++++++++++++++++++++- nixos/tests/printing.nix | 1 + 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix index 2515c1c1668..fd9589883ed 100644 --- a/nixos/modules/services/printing/cupsd.nix +++ b/nixos/modules/services/printing/cupsd.nix @@ -72,6 +72,30 @@ in ''; }; + defaultShared = mkOption { + type = types.bool; + default = false; + description = '' + Specifies whether local printers are shared by default. + ''; + }; + + browsing = mkOption { + type = types.bool; + default = false; + description = '' + Specifies whether shared printers are advertised. + ''; + }; + + webInterface = mkOption { + type = types.bool; + default = true; + description = '' + Specifies whether the web interface is enabled. + ''; + }; + cupsdConf = mkOption { type = types.lines; default = ""; @@ -259,7 +283,11 @@ in SetEnv PATH ${bindir}/lib/cups/filter:${bindir}/bin:${bindir}/sbin - Browsing On + DefaultShared ${if cfg.defaultShared then "Yes" else "No"} + + Browsing ${if cfg.browsing then "Yes" else "No"} + + WebInterface ${if cfg.webInterface then "Yes" else "No"} DefaultAuthType Basic diff --git a/nixos/tests/printing.nix b/nixos/tests/printing.nix index 65d573e690b..708ff539157 100644 --- a/nixos/tests/printing.nix +++ b/nixos/tests/printing.nix @@ -9,6 +9,7 @@ import ./make-test.nix ({pkgs, ... }: { { config, pkgs, ... }: { services.printing.enable = true; services.printing.listenAddresses = [ "*:631" ]; + services.printing.defaultShared = true; services.printing.extraConf = '' -- cgit 1.4.1