mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
cups: Add a listenAddresses option
This commit is contained in:
parent
cd05320716
commit
b8d59765e1
|
@ -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 {
|
||||
type = types.lines;
|
||||
internal = true;
|
||||
|
@ -154,7 +163,9 @@ in
|
|||
|
||||
SystemGroup root wheel
|
||||
|
||||
Listen localhost:631
|
||||
${concatMapStrings (addr: ''
|
||||
Listen ${addr}
|
||||
'') cfg.listenAddresses}
|
||||
Listen /var/run/cups/cups.sock
|
||||
|
||||
# Note: we can't use ${cups}/etc/cups as the ServerRoot, since
|
||||
|
|
|
@ -7,9 +7,9 @@ import ./make-test.nix ({pkgs, ... }: {
|
|||
server =
|
||||
{ config, pkgs, ... }:
|
||||
{ services.printing.enable = true;
|
||||
services.printing.listenAddresses = [ "*:631" ];
|
||||
services.printing.cupsdConf =
|
||||
''
|
||||
Listen server:631
|
||||
<Location />
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
|
|
Loading…
Reference in a new issue