From d93fb1bd1008b376a536a4a82ba189742b47293c Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Thu, 16 May 2024 18:31:09 +0200 Subject: [PATCH] nixos/hardware/printers: fix ppdOptions of ensured printers Commit a52e27d4f637854e81dfd51da3b29627f7374513 changed the `ensurePrinter` mechanism such that it uses `lib.cli.toGNUCommandLineShell` to assemble the `lpadmin` command line that creates the required printer. Before that commit, the command line contained single quotes (')to protect certain options from being (mis-)interpreted by the shell. The new mechanism no longer needs those quotes as `lib.cli.toGNUCommandLineShell` takes care of quoting/escaping. Unfortunatelly, the commit missed the quotes around the `-o` command line part. `lib.cli.toGNUCommandLineShell` now properly escapes those quotes, thereby including them in the effective command line arguments that are passed to `lpadmin`. The result is that no option is applied anymore. The commit at hand simply removes the superfluous quotes. With this change, options are again properly applied as before. --- nixos/modules/hardware/printers.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/hardware/printers.nix b/nixos/modules/hardware/printers.nix index de2f84d4831b..ace900d88586 100644 --- a/nixos/modules/hardware/printers.nix +++ b/nixos/modules/hardware/printers.nix @@ -13,7 +13,7 @@ let } // optionalAttrs (p.description != null) { D = p.description; } // optionalAttrs (p.ppdOptions != {}) { - o = mapAttrsToList (name: value: "'${name}'='${value}'") p.ppdOptions; + o = mapAttrsToList (name: value: "${name}=${value}") p.ppdOptions; }); in '' ${pkgs.cups}/bin/lpadmin ${args} -E