<commit_before>{ stdenv, lib, goPackages, fetchFromGitHub, vim }:

goPackages.buildGoPackage rec {
  name = "prometheus-${version}";
  version = "0.15.1";
  goPackagePath = "github.com/prometheus/prometheus";
  rev = "64349aade284846cb194be184b1b180fca629a7c";

  src = fetchFromGitHub {
    inherit rev;
    owner = "prometheus";
    repo = "prometheus";
    sha256 = "0gljpwnlip1fnmhbc96hji2rc56xncy97qccm7v1z5j1nhc5fam2";
  };

  buildInputs = with goPackages; [
    consul
    dns
    fsnotify.v1
    go-zookeeper
    goleveldb
    httprouter
    logrus
    net
    prometheus.client_golang
    prometheus.log
    yaml-v2
  ];

  # Metadata that gets embedded into the binary
  buildFlagsArray = let t = "${goPackagePath}/version"; in
  ''
    -ldflags=
        -X ${t}.Version=${version}
        -X ${t}.Revision=${builtins.substring 0 6 rev}
        -X ${t}.Branch=master
        -X ${t}.BuildUser=nix@nixpkgs
        -X ${t}.BuildDate=20150101-00:00:00
        -X ${t}.GoVersion=${lib.getVersion goPackages.go}
  '';

  meta = with lib; {
    description = "Service monitoring system and time series database";
    homepage = http://prometheus.io;
    license = licenses.asl20;
    maintainers = with maintainers; [ benley ];
    platforms = platforms.unix;
  };
}
<commit_msg>prometheus: Include console templates and libraries<commit_after>{ stdenv, lib, goPackages, fetchFromGitHub, vim }:

let self = goPackages.buildGoPackage rec {
  name = "prometheus-${version}";
  version = "0.15.1";
  goPackagePath = "github.com/prometheus/prometheus";
  rev = "64349aade284846cb194be184b1b180fca629a7c";

  src = fetchFromGitHub {
    inherit rev;
    owner = "prometheus";
    repo = "prometheus";
    sha256 = "0gljpwnlip1fnmhbc96hji2rc56xncy97qccm7v1z5j1nhc5fam2";
  };

  buildInputs = with goPackages; [
    consul
    dns
    fsnotify.v1
    go-zookeeper
    goleveldb
    httprouter
    logrus
    net
    prometheus.client_golang
    prometheus.log
    yaml-v2
  ];

  preInstall = ''
    mkdir -p "$bin/share/doc/prometheus" "$bin/etc/prometheus"
    cp -a $src/documentation/* $bin/share/doc/prometheus
    cp -a $src/console_libraries $src/consoles $bin/etc/prometheus
  '';

  # Metadata that gets embedded into the binary
  buildFlagsArray = let t = "${goPackagePath}/version"; in
  ''
    -ldflags=
        -X ${t}.Version=${version}
        -X ${t}.Revision=${builtins.substring 0 6 rev}
        -X ${t}.Branch=master
        -X ${t}.BuildUser=nix@nixpkgs
        -X ${t}.BuildDate=20150101-00:00:00
        -X ${t}.GoVersion=${lib.getVersion goPackages.go}
  '';

  meta = with lib; {
    description = "Service monitoring system and time series database";
    homepage = http://prometheus.io;
    license = licenses.asl20;
    maintainers = with maintainers; [ benley ];
    platforms = platforms.unix;
  };
};

in self.bin

{'fraction_non_alphanumeric': 0.12627506155469576, 'fraction_numerical': 0.04713330988392543, 'mean_word_length': 3.028328611898017, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1361597', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1014, 'n_words': 203}