anchor.diff:    # we can't update ${cups}/lib/cups itself, we create a symlink tree
     # here and add the additional programs.  The ServerBin directive in
     # cupsd.conf tells cupsd to use this tree.
  -  bindir = pkgs.runCommand "cups-progs" {}
  -    ''
  -      ensureDir $out/lib/cups
  -      ln -s ${cups}/lib/cups/* $out/lib/cups/
  -
  -      # Provide support for printing via SMB.    
  -      rm $out/lib/cups/backend
  -      ensureDir $out/lib/cups/backend
  -      ln -s ${cups}/lib/cups/backend/* $out/lib/cups/backend/
  -      ln -s ${pkgs.samba}/bin/smbspool $out/lib/cups/backend/smb
  +  bindir = pkgs.buildEnv {
  +    name = "cups-progs";
  +    paths = cfg.drivers;
  +    pathsToLink = [ "/lib/cups" "/share/cups" ];
  +    postBuild =  ''
  +      ${pkgs.coreutils}/bin/mkdir -p $out/lib/cups/backend
  +      ${pkgs.coreutils}/bin/ln -s ${pkgs.samba}/bin/smbspool $out/lib/cups/backend/smb
   
         # Provide support for printing via HTTPS.
  -      ln -s ipp $out/lib/cups/backend/https
  +      ${pkgs.coreutils}/bin/ln -s ipp $out/lib/cups/backend/https
   
  -      # Provide Ghostscript rasterisation, necessary for non-Postscript
  -      # printers.
  -      rm $out/lib/cups/filter
  -      ensureDir $out/lib/cups/filter
  -      ln -s ${cups}/lib/cups/filter/* $out/lib/cups/filter/
  -      ln -s ${pkgs.ghostscript}/lib/cups/filter/* $out/lib/cups/filter/
         ${cfg.bindirCmds}
  -    ''; # */
  +    '';
  +  };
   
   in
   
  
positive.code:         ServerRoot /etc/cups
  
          ServerBin ${bindir}/lib/cups
  
          AccessLog ${logDir}/access_log
          ErrorLog ${logDir}/error_log
  
negative.code:         exec = "${cups}/sbin/cupsd -c ${pkgs.writeText "cupsd.conf" cfg.cupsdConf} -F";
        };
  
      services.printing.drivers = [ pkgs.cups pkgs.ghostscript ];
      services.printing.cupsdConf = 
        ''
          LogLevel info
  