summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2014-09-03 10:51:49 +0400
committerMichael Raskin <7c6f434c@mail.ru>2014-09-03 10:51:49 +0400
commit8e968b18e457a5448cc52c155d922ce15f9b1ede (patch)
tree98ba6a8cd04da81f4dc089b84932ecf542783aa8 /nixos
parenta82c623c26e0d4addbfc6530b15ff7dd5c55b967 (diff)
parentf28d8c2dc43fc14598f4ecbea2cba3974263a278 (diff)
downloadnixlib-8e968b18e457a5448cc52c155d922ce15f9b1ede.tar
nixlib-8e968b18e457a5448cc52c155d922ce15f9b1ede.tar.gz
nixlib-8e968b18e457a5448cc52c155d922ce15f9b1ede.tar.bz2
nixlib-8e968b18e457a5448cc52c155d922ce15f9b1ede.tar.lz
nixlib-8e968b18e457a5448cc52c155d922ce15f9b1ede.tar.xz
nixlib-8e968b18e457a5448cc52c155d922ce15f9b1ede.tar.zst
nixlib-8e968b18e457a5448cc52c155d922ce15f9b1ede.zip
Merge pull request #2952 from edwtjo/cups-syswide-clientconf
CUPS system wide client side remote printing.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/printing/cupsd.nix24
1 files changed, 23 insertions, 1 deletions
diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix
index d229c610669f..8a8085cad280 100644
--- a/nixos/modules/services/printing/cupsd.nix
+++ b/nixos/modules/services/printing/cupsd.nix
@@ -35,7 +35,7 @@ let
   bindir = pkgs.buildEnv {
     name = "cups-progs";
     paths = cfg.drivers;
-    pathsToLink = [ "/lib/cups" "/share/cups" "/bin" ];
+    pathsToLink = [ "/lib/cups" "/share/cups" "/bin" "/etc/cups" ];
     postBuild = cfg.bindirCmds;
   };
 
@@ -89,6 +89,20 @@ in
         '';
       };
 
+      clientConf = mkOption {
+        type = types.lines;
+        default = "";
+        example =
+          ''
+            ServerName server.example.com
+            Encryption Never
+          '';
+        description = ''
+          The contents of the client configuration.
+          (<filename>client.conf</filename>)
+        '';
+      };
+
       drivers = mkOption {
         type = types.listOf types.path;
         example = literalExample "[ pkgs.splix ]";
@@ -124,6 +138,14 @@ in
 
     environment.systemPackages = [ cups ];
 
+    environment.variables.CUPS_SERVERROOT = "/etc/cups";
+
+    environment.etc = [
+      { source = pkgs.writeText "client.conf" cfg.clientConf;
+        target = "cups/client.conf";
+      }
+    ];
+
     services.dbus.packages = [ cups ];
 
     # Cups uses libusb to talk to printers, and does not use the