summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJascha Geerds <jg@ekby.de>2015-05-04 22:32:35 +0200
committerDomen Kožar <domen@dev.si>2015-05-10 12:41:21 +0200
commit2cc8d156532aa776c53307375acafb80a4a3cfd3 (patch)
tree318ee9f11848f49ac55574d144e7900b41676a0f /nixos
parent55a6469ba36e840e2388673318b51bc77cb3f7ba (diff)
downloadnixpkgs-2cc8d156532aa776c53307375acafb80a4a3cfd3.tar
nixpkgs-2cc8d156532aa776c53307375acafb80a4a3cfd3.tar.gz
nixpkgs-2cc8d156532aa776c53307375acafb80a4a3cfd3.tar.bz2
nixpkgs-2cc8d156532aa776c53307375acafb80a4a3cfd3.tar.lz
nixpkgs-2cc8d156532aa776c53307375acafb80a4a3cfd3.tar.xz
nixpkgs-2cc8d156532aa776c53307375acafb80a4a3cfd3.tar.zst
nixpkgs-2cc8d156532aa776c53307375acafb80a4a3cfd3.zip
cups: Add defaultShared, browsing and webInterace config option
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/printing/cupsd.nix30
-rw-r--r--nixos/tests/printing.nix1
2 files changed, 30 insertions, 1 deletions
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 =
           ''
             <Location />