anchor.diff:      services.lighttpd.enableModules = [ "mod_cgi" "mod_alias" "mod_setenv" ];
   
       services.lighttpd.extraConfig = ''
  -      $HTTP["url"] =~ "^/cgit" {
  +      $HTTP["url"] =~ "^/${cfg.subdir}" {
             cgi.assign = (
                 "cgit.cgi" => "${pkgs.cgit}/cgit/cgit.cgi"
             )
             alias.url = (
  -              "/cgit.css" => "${pkgs.cgit}/cgit/cgit.css",
  -              "/cgit.png" => "${pkgs.cgit}/cgit/cgit.png",
  -              "/cgit"     => "${pkgs.cgit}/cgit/cgit.cgi"
  +              "${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}"
  
positive.code: 
  let
    cfg = config.services.lighttpd.cgit;
    configFile = pkgs.writeText "cgitrc"
      ''
        ${cfg.configText}
      '';
  in
  
negative.code:       type = types.bool;
        description = ''
          If true, enable cgit (fast web interface for git repositories) as a
          sub-service in lighttpd.
        '';
      };
  
      subdir = mkOption {
        default = "cgit";
        example = "";
        type = types.str;
        description = ''
          The subdirectory in which to serve cgit. The web application will be
          accessible at http://yourserver/''${subdir}
        '';
      };
  
  