Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
4b871d332e
commit
a74ee06ec3
1 changed files with 23 additions and 0 deletions
23
modules/scripts/onchange.nix
Normal file
23
modules/scripts/onchange.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
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 "$@"
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue