git.iko.soy/typeable/nixpkgs
on master help sign in
use symlink to ensure cupsd.conf PATH always points to a valid store path

even if cups rewrites its config file due to config changes made through its web-based management UI, we need to keep the PATH pointing to currently-live nix store directories. fixes #20806.

commit05fb82732c97582ecf0a35ed81111ab5d1c088d4 authorMatt McHenry <github@matt.mchenryfamily.org> dateTue 13 Dec 2016, 21:23 (10 years ago) parent1c50bdd
1 file changed+8−1
nixos/modules/services/printing/cupsd.nix+8−1
nixos/modules/services/printing/cupsd.nix+8−1
@@ -75,7 +75,7 @@ let
7575 '') cfg.listenAddresses}
7676 Listen /var/run/cups/cups.sock
7777
78− SetEnv PATH ${bindir}/lib/cups/filter:${bindir}/bin
78+ SetEnv PATH /var/lib/cups/path/lib/cups/filter:/var/lib/cups/path/bin
7979
8080 DefaultShared ${if cfg.defaultShared then "Yes" else "No"}
8181
@@ -310,6 +310,13 @@ in
310310 for i in *; do
311311 [ ! -e "/var/lib/cups/$i" ] && ln -s "${rootdir}/etc/cups/$i" "/var/lib/cups/$i"
312312 done
313+
314+ #update path reference
315+ [ -L /var/lib/cups/path ] && \
316+ rm /var/lib/cups/path
317+ [ ! -e /var/lib/cups/path ] && \
318+ ln -s ${bindir} /var/lib/cups/path
319+
313320 ${optionalString cfg.gutenprint ''
314321 if [ -d /var/lib/cups/ppd ]; then
315322 ${gutenprint}/bin/cups-genppdupdate -p /var/lib/cups/ppd