anchor.diff:        '';
   
         postStart = ''
  -        until [[ $(${pkgs.curl.bin}/bin/curl -L -s --head -w '\n%{http_code}' http://${cfg.listenAddress}:${toString cfg.port}${cfg.prefix} | tail -n1) =~ ^(200|403)$ ]]; do
  +        until [[ $(${pkgs.curl.bin}/bin/curl -L -s --head -w '\n%{http_code}' ${jenkinsUrl} | tail -n1) =~ ^(200|403)$ ]]; do
             sleep 1
           done
         '';
  
positive.code: with lib;
  let
    cfg = config.services.jenkins;
  in {
    options = {
      services.jenkins = {
  
negative.code:           Additional command line arguments to pass to the Java run time (as opposed to Jenkins).
          '';
        };
  
        withCLI = mkOption {
          type = types.bool;
          default = false;
          description = ''
            Whether to make the CLI available.
  
            More info about the CLI available at
            <link xlink:href="https://www.jenkins.io/doc/book/managing/cli">
            https://www.jenkins.io/doc/book/managing/cli</link> .
          '';
        };
      };
    };
  
    config = mkIf cfg.enable {
      environment = {
        # server references the dejavu fonts
        systemPackages = [
          pkgs.dejavu_fonts
        ] ++ optional cfg.withCLI cfg.package;
  
        variables = {}
          // optionalAttrs cfg.withCLI {
            # Make it more convenient to use the `jenkins-cli`.
            JENKINS_URL = jenkinsUrl;
          };
      };
  
      users.groups = optionalAttrs (cfg.group == "jenkins") {
        jenkins.gid = config.ids.gids.jenkins;
  