From 9cca2a5850d9f6659267de49e9b09015da554ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 26 Oct 2023 11:37:39 +0300 Subject: [PATCH] Revert "hm: remove watchman" This reverts commit 821a964af5766c1135572ffa22dd14a1cd230023. --- shared/home/default.nix | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/shared/home/default.nix b/shared/home/default.nix index 9b3436f..9c3bf48 100644 --- a/shared/home/default.nix +++ b/shared/home/default.nix @@ -5,7 +5,26 @@ email, devEnvironment, ... -}: { +}: let + queryWatchman = with pkgs; let + # TODO: this is a perl script which needs $LOCALE_ARCHIVE. + # As of writing, I have this in my ~/.bashrc: + # export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive + fsmon = + runCommand "fsmonitor-watchman" + { + src = "${git}/share/git-core/templates/hooks/fsmonitor-watchman.sample"; + buildInputs = [gnused]; + } '' + sed -e 's@^#!/usr/bin/perl@#!${perl}@' $src > $out + chmod +x $out + ''; + in + writeShellScript "query-watchman" '' + export PATH=${pkgs.watchman}/bin:$PATH + exec ${fsmon.outPath} "$@" + ''; +in { home = { inherit stateVersion; @@ -75,6 +94,8 @@ userName = "Motiejus Jakštys"; aliases.yolo = "commit --amend --no-edit -a"; extraConfig = { + core.fsmonitor = queryWatchman.outPath; + core.untrackedcache = true; rerere.enabled = true; pull.ff = "only"; merge.conflictstyle = "diff3";