diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix
index 59306d625e6..e67badfcd29 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}