<commit_before>{ stdenv
, fetchurl

, ncurses
, zlib
}:

stdenv.mkDerivation rec {
  name = "atop-2.4.0";

  src = fetchurl {
    url = "http://www.atoptool.nl/download/${name}.tar.gz";
    multihash = "QmZHZaxpfoYgK2gshBCuwjW9fMDj132YyRaV91AGmNmqca";
    sha256 = "be1c010a77086b7d98376fce96514afcd73c3f20a8d1fe01520899ff69a73d69";
  };

  buildInputs = [
    ncurses
    zlib
  ];

  postPatch = ''
    grep -q 'chown' Makefile
    sed -i 's,chown,true,g' Makefile
  '' + /* Cannot setuid inside of nix-builder */ ''
    sed -i Makefile \
      -e 's/chmod 04711/chmod 0711/'
  '';

  preBuild = ''
    makeFlagsArray+=(
      "BINPATH=$out/bin"
      "SBINPATH=$out/bin"
      "SCRPATH=$out/share/atop"
      "MAN1PATH=$out/share/man/man1"
      "MAN5PATH=$out/share/man/man5"
      "MAN8PATH=$out/share/man/man8"
      "SYSDPATH=$out/lib/systemd/system"
      "PMPATH1=$out/lib/pm-utils/sleep.d"
      "PMPATHD=$out/lib/systemd/system-sleep"
    )
  '';

  preInstall = ''
    installFlagsArray+=(
      "INIPATH=$TMPDIR"
      "CRNPATH=$TMPDIR"
      "LOGPATH=$TMPDIR"
      "ROTPATH=$out/etc/logrotate.d"
    )
  '';

  installTargets = [
    "systemdinstall"
  ];

  meta = with stdenv.lib; {
    description = "Console system performance monitor";
    maintainers = with maintainers; [
      wkennington
    ];<commit_msg>atop: cleanup<commit_after>{ stdenv
, fetchurl
, lib

, ncurses
, zlib
}:

stdenv.mkDerivation rec {
  name = "atop-2.4.0";

  src = fetchurl {
    url = "http://www.atoptool.nl/download/${name}.tar.gz";
    multihash = "QmZHZaxpfoYgK2gshBCuwjW9fMDj132YyRaV91AGmNmqca";
    sha256 = "be1c010a77086b7d98376fce96514afcd73c3f20a8d1fe01520899ff69a73d69";
  };

  buildInputs = [
    ncurses
    zlib
  ];

  postPatch = ''
    grep -q 'chown' Makefile
    sed -i 's,chown,true,g' Makefile
  '' + /* Cannot setuid inside of nix-builder */ ''
    sed -i Makefile \
      -e 's/chmod 04711/chmod 0711/'
  '';

  preBuild = ''
    makeFlagsArray+=(
      "BINPATH=$out/bin"
      "SBINPATH=$out/bin"
      "SCRPATH=$out/share/atop"
      "MAN1PATH=$out/share/man/man1"
      "MAN5PATH=$out/share/man/man5"
      "MAN8PATH=$out/share/man/man8"
      "SYSDPATH=$out/lib/systemd/system"
      "PMPATH1=$out/lib/pm-utils/sleep.d"
      "PMPATHD=$out/lib/systemd/system-sleep"
    )
  '';

  preInstall = ''
    installFlagsArray+=(
      "INIPATH=$TMPDIR"
      "CRNPATH=$TMPDIR"
      "LOGPATH=$TMPDIR"
      "ROTPATH=$out/etc/logrotate.d"
    )
  '';

  installTargets = [
    "systemdinstall"
  ];

  meta = with lib; {
    description = "Console system performance monitor";
    maintainers = with maintainers; [
      wkennington
    ];
{'fraction_non_alphanumeric': 0.15231289958631064, 'fraction_numerical': 0.05265137269650245, 'mean_word_length': 2.7099023709902372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6865880', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1114, 'n_words': 148}