anchor.diff:            Directory holding all state for nginx to run.
           ";
         };
  +
  +      user = mkOption {
  +        default = "nginx";
  +        description = "User account under which nginx runs.";
  +      };
  +
  +      group = mkOption {
  +        default = "nginx";
  +        description = "Group account under which nginx runs.";
  +      };
  +
  +      fullWebDAV = mkOption {
  +        default = false;
  +        description = "Compile in a third party module providing full WebDAV support";
  +      };
       };
   
     };
   
     config = mkIf cfg.enable {
  -    environment.systemPackages = [ pkgs.nginx ];
  +    environment.systemPackages = [ nginx ];
   
       # TODO: test user supplied config file pases syntax test
   
  
positive.code: 
  let
    cfg = config.services.nginx;
    configFile = pkgs.writeText "nginx.conf" ''
      user nginx nginx;
      daemon off;
      ${cfg.config}
    '';
  
negative.code:       description = "Nginx Web Server";
        after = [ "network.target" ];
        wantedBy = [ "multi-user.target" ];
        path = [ nginx ];
        preStart =
          ''
          mkdir -p ${cfg.stateDir}/logs
          chown -R ${cfg.user}:${cfg.group} ${cfg.stateDir}
          '';
        serviceConfig = {
          ExecStart = "${nginx}/bin/nginx -c ${configFile} -p ${cfg.stateDir}";
        };
      };
  
  