<commit_before>{ stdenv, lib, fetchurl }:
stdenv.mkDerivation rec {
  name = "now-cli-${version}";
  version = "13.0.4";

  # TODO: switch to building from source, if possible
  src = fetchurl {
    url = "https://github.com/zeit/now-cli/releases/download/${version}/now-linux.gz";
    sha256 = "0qiykqrdd1yv6n1kzkzp300j32g682rv4p0l39rgnczdaiqcv9w5";
  };

  sourceRoot = ".";
  unpackCmd = ''
    gunzip -c $curSrc > now-linux
  '';

  buildPhase = ":";

  installPhase = ''
    mkdir $out
    mkdir $out/bin
    cp now-linux $out/bin/now
  '';

    # now is a node program packaged using zeit/pkg.
    # thus, it contains hardcoded offsets.
    # patchelf shifts these locations when it expands headers.

    # this could probably be generalised into allowing any program packaged
    # with zeit/pkg to be run on nixos.

  preFixup = let
    libPath = lib.makeLibraryPath [stdenv.cc.cc];
  in ''<commit_msg>now-cli: 13.0.4 -> 13.1.2<commit_after>{ stdenv, lib, fetchurl }:
stdenv.mkDerivation rec {
  name = "now-cli-${version}";
  version = "13.1.2";

  # TODO: switch to building from source, if possible
  src = fetchurl {
    url = "https://github.com/zeit/now-cli/releases/download/${version}/now-linux.gz";
    sha256 = "0hgbmvhzxkr84ilrzjxnj3p5pkibam739cckpvwalq5q1ddy2cn4";
  };

  sourceRoot = ".";
  unpackCmd = ''
    gunzip -c $curSrc > now-linux
  '';

  buildPhase = ":";

  installPhase = ''
    mkdir $out
    mkdir $out/bin
    cp now-linux $out/bin/now
  '';

    # now is a node program packaged using zeit/pkg.
    # thus, it contains hardcoded offsets.
    # patchelf shifts these locations when it expands headers.

    # this could probably be generalised into allowing any program packaged
    # with zeit/pkg to be run on nixos.

  preFixup = let
    libPath = lib.makeLibraryPath [stdenv.cc.cc];
  in ''
{'fraction_non_alphanumeric': 0.12554585152838427, 'fraction_numerical': 0.028384279475982533, 'mean_word_length': 2.984782608695652, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '6947195', 'n_tokens_mistral': 703, 'n_tokens_neox': 652, 'n_words': 168}