anchor.diff:  
   let
     cfg = config.services.lighttpd.cgit;
  +  pathPrefix = if stringLength cfg.subdir == 0 then "" else "/" + cfg.subdir;
     configFile = pkgs.writeText "cgitrc"
       ''
  +      # default paths to static assets
  +      css=${pathPrefix}/cgit.css
  +      logo=${pathPrefix}/cgit.png
  +      favicon=${pathPrefix}/favicon.ico
  +
  +      # user configuration
         ${cfg.configText}
       '';
   in
  
positive.code:       type = types.bool;
        description = ''
          If true, enable cgit (fast web interface for git repositories) as a
          sub-service in lighttpd. cgit will be accessible at
          http://yourserver/cgit
        '';
      };
  
  
negative.code:     services.lighttpd.enableModules = [ "mod_cgi" "mod_alias" "mod_setenv" ];
  
      services.lighttpd.extraConfig = ''
        $HTTP["url"] =~ "^/${cfg.subdir}" {
            cgi.assign = (
                "cgit.cgi" => "${pkgs.cgit}/cgit/cgit.cgi"
            )
            alias.url = (
                "${pathPrefix}/cgit.css" => "${pkgs.cgit}/cgit/cgit.css",
                "${pathPrefix}/cgit.png" => "${pkgs.cgit}/cgit/cgit.png",
                "${pathPrefix}"          => "${pkgs.cgit}/cgit/cgit.cgi"
            )
            setenv.add-environment = (
                "CGIT_CONFIG" => "${configFile}"
  