cups: Add a listenAddresses option

This commit is contained in:
Eelco Dolstra 2014-04-25 00:30:12 +02:00
parent cd05320716
commit b8d59765e1
2 changed files with 13 additions and 2 deletions

View File

@ -56,6 +56,15 @@ in
''; '';
}; };
listenAddresses = mkOption {
type = types.listOf types.str;
default = [ "127.0.0.1:631" ];
example = [ "*:631" ];
description = ''
A list of addresses and ports on which to listen.
'';
};
bindirCmds = mkOption { bindirCmds = mkOption {
type = types.lines; type = types.lines;
internal = true; internal = true;
@ -154,7 +163,9 @@ in
SystemGroup root wheel SystemGroup root wheel
Listen localhost:631 ${concatMapStrings (addr: ''
Listen ${addr}
'') cfg.listenAddresses}
Listen /var/run/cups/cups.sock Listen /var/run/cups/cups.sock
# Note: we can't use ${cups}/etc/cups as the ServerRoot, since # Note: we can't use ${cups}/etc/cups as the ServerRoot, since

View File

@ -7,9 +7,9 @@ import ./make-test.nix ({pkgs, ... }: {
server = server =
{ config, pkgs, ... }: { config, pkgs, ... }:
{ services.printing.enable = true; { services.printing.enable = true;
services.printing.listenAddresses = [ "*:631" ];
services.printing.cupsdConf = services.printing.cupsdConf =
'' ''
Listen server:631
<Location /> <Location />
Order allow,deny Order allow,deny
Allow from all Allow from all