<commit_before>{ stdenv, fetchgit, pkgconfig, vte, gtk3, ncurses, makeWrapper, symlinkJoin
, configFile ? null
}:

let 
  version = "12";
  termite = stdenv.mkDerivation {
    name = "termite-${version}";

    src = fetchgit {
      url = "https://github.com/thestinger/termite";
      rev = "refs/tags/v${version}";
      sha256 = "0s6dyg3vcqk5qcx90bs24wdnd3p56rdjdcanx4pcxvp6ksjl61jz";
    };

    postPatch = "sed '1i#include <math.h>' -i termite.cc";

    makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ];

    buildInputs = [ pkgconfig vte gtk3 ncurses ];

    outputs = [ "out" "terminfo" ];

    postInstall = ''
      mkdir -p $terminfo/share
      mv $out/share/terminfo $terminfo/share/terminfo

      mkdir -p $out/nix-support
      echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
    '';

    meta = with stdenv.lib; {
      description = "A simple VTE-based terminal";
      license = licenses.lgpl2Plus;
      homepage = https://github.com/thestinger/termite/;
      maintainers = with maintainers; [ <NAME> ];
      platforms = platforms.all;
    };
  };
in if configFile == null then termite else symlinkJoin {
  name = "termite-with-config-${version}";
  paths = [ termite ];
  nativeBuildInputs = [ makeWrapper ];
  postBuild = ''
    wrapProgram $out/bin/termite \
      --add-flags "--config ${configFile}"<commit_msg>termite: fix fonts in wayland<commit_after>{ stdenv, fetchgit, pkgconfig, vte, gtk3, ncurses, makeWrapper, symlinkJoin
, configFile ? null
}:

let 
  version = "12";
  termite = stdenv.mkDerivation {
    name = "termite-${version}";

    src = fetchgit {
      url = "https://github.com/thestinger/termite";
      rev = "refs/tags/v${version}";
      sha256 = "0s6dyg3vcqk5qcx90bs24wdnd3p56rdjdcanx4pcxvp6ksjl61jz";
    };

    postPatch = "sed '1i#include <math.h>' -i termite.cc";

    makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ];

    buildInputs = [ pkgconfig vte gtk3 ncurses ];

    nativeBuildInputs = [ makeWrapper ];

    outputs = [ "out" "terminfo" ];

    postInstall = ''
      mkdir -p $terminfo/share
      mv $out/share/terminfo $terminfo/share/terminfo

      mkdir -p $out/nix-support
      echo "$terminfo" >> $out/nix-support/propagated-user-env-packages

      wrapProgram $out/bin/termite \
        --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
    '';

    meta = with stdenv.lib; {
      description = "A simple VTE-based terminal";
      license = licenses.lgpl2Plus;
      homepage = https://github.com/thestinger/termite/;
      maintainers = with maintainers; [ <NAME> ];
      platforms = platforms.all;
    };
  };
in if configFile == null then termite else symlinkJoin {
  name = "termite-with-config-${version}";
  paths = [ termite ];
  nativeBuildInputs = [ makeWrapper ];
  postBuild = ''
    wrapProgram $out/bin/termite \
      --add-flags "--config ${configFile}"
{'fraction_non_alphanumeric': 0.145912383580545, 'fraction_numerical': 0.016557433597792343, 'mean_word_length': 2.994490358126722, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 4, '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': '5617607', 'n_tokens_mistral': 1056, 'n_tokens_neox': 1011, 'n_words': 200}