anchor.diff:          description = ''
             The contents of the configuration file of the CUPS daemon
             (<filename>cupsd.conf</filename>).
  +        '';
  +      };
  +
  +      drivers = mkOption {
  +        example = [ pkgs.splix ];
  +        description = ''
  +          CUPS drivers (CUPS, gs and samba are added unconditionally).
           '';
         };
   
  
positive.code:         ServerRoot /etc/cups
  
          ServerBin ${bindir}/lib/cups
  
          AccessLog ${logDir}/access_log
          ErrorLog ${logDir}/error_log
  
negative.code:   # 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.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.
        ${pkgs.coreutils}/bin/ln -s ipp $out/lib/cups/backend/https
  
        ${cfg.bindirCmds}
      '';
    };
  
  in
  
  