From f28d8c2dc43fc14598f4ecbea2cba3974263a278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edward=20Tj=C3=B6rnhammar?= Date: Wed, 11 Jun 2014 21:52:53 +0200 Subject: [PATCH] CUPS system wide client configuration. --- nixos/modules/services/printing/cupsd.nix | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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. + (client.conf) + ''; + }; + 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