nix-config/modules/scripts/onchange.nix

24 lines
415 B
Nix
Raw Normal View History

{
flake.modules.homeManager.base =
{ pkgs, ... }:
{
home.packages = [
(pkgs.writeShellApplication {
name = "onchange";
runtimeInputs = with pkgs; [
coreutils
entr
];
text = ''
PATTERN="$1"
shift 1
find . -path "$PATTERN" -type f | entr -cs "$@"
'';
})
];
};
}