From 7fd15e41741d8899b65eb10d668ea03fcd15558e Mon Sep 17 00:00:00 2001 From: buffet Date: Sat, 10 Aug 2024 17:23:41 +0200 Subject: [PATCH 1/2] feat: install entr --- users/buffet/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/users/buffet/default.nix b/users/buffet/default.nix index 01f0078..7f4a437 100644 --- a/users/buffet/default.nix +++ b/users/buffet/default.nix @@ -10,6 +10,7 @@ ./foot.nix ./fzf.nix ./git.nix + ./git-entr.nix ./ime.nix ./mako.nix ./nixvim.nix @@ -55,6 +56,7 @@ alejandra clang du-dust + entr fd fx gdb -- 2.46.0 From d484e94c44c5e9132b646424d06638118498d7cd Mon Sep 17 00:00:00 2001 From: buffet Date: Sat, 10 Aug 2024 17:23:47 +0200 Subject: [PATCH 2/2] feat: install git-entr script The script lists all files in the git repository that are not ignored, and runs a given command on change using entr. --- users/buffet/git-entr.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 users/buffet/git-entr.nix diff --git a/users/buffet/git-entr.nix b/users/buffet/git-entr.nix new file mode 100644 index 0000000..d0dd76b --- /dev/null +++ b/users/buffet/git-entr.nix @@ -0,0 +1,15 @@ +{pkgs, ...}: { + home-manager.users.buffet = { + home.packages = [ + (pkgs.writeScriptBin "git-entr" '' + #!/bin/sh + + echo "looping entr. press ctrl-c twice to exit" + + while sleep 1; do + git ls-files -cdmo --exclude-standard | entr -d "$@" + done + '') + ]; + }; +} -- 2.46.0