From 4062592f3a17d814812ca696604ea22ad615ca12 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 25 Apr 2020 19:48:34 +0200 Subject: nixos/printing: make access to web-interface configurable Otherwise you'd always get a 403 when hosting the web-interface of cups at a different location than `localhost`. --- nixos/modules/services/printing/cupsd.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'nixos/modules/services/printing') diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix index 59306d625e6b..e67badfcd29e 100644 --- a/nixos/modules/services/printing/cupsd.nix +++ b/nixos/modules/services/printing/cupsd.nix @@ -153,6 +153,16 @@ in ''; }; + allowFrom = mkOption { + type = types.listOf types.str; + default = [ "localhost" ]; + example = [ "all" ]; + apply = concatMapStringsSep "\n" (x: "Allow ${x}"); + description = '' + From which hosts to allow unconditional access. + ''; + }; + bindirCmds = mkOption { type = types.lines; internal = true; @@ -403,19 +413,19 @@ in Order allow,deny - Allow localhost + ${cfg.allowFrom} Order allow,deny - Allow localhost + ${cfg.allowFrom} AuthType Basic Require user @SYSTEM Order allow,deny - Allow localhost + ${cfg.allowFrom} -- cgit 1.4.1