mirror of https://github.com/bjeanes/dotfiles.git
Set up regular task to clear ~/Downloads of older files
parent
5f38f29d38
commit
f366cf3e49
19
flake.nix
19
flake.nix
|
@ -170,6 +170,25 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
launchd.user.agents.gc-downloads =
|
||||||
|
let
|
||||||
|
# shell = "${pkgs.bash}/bin/bash";
|
||||||
|
find = "${pkgs.findutils}/bin/find";
|
||||||
|
downloads = "/Users/${myUsername}/Downloads";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
serviceConfig = {
|
||||||
|
ProcessType = "Background";
|
||||||
|
RunAtLoad = true;
|
||||||
|
StartInterval = 6 * 60 * 60; # every 6 hours
|
||||||
|
};
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
${find} ${downloads} -type f -mtime +30 -print -delete
|
||||||
|
${find} ${downloads} -type d -not -wholename "${downloads}" -empty -print -delete
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
homebrew.enable = true;
|
homebrew.enable = true;
|
||||||
homebrew.taps = [
|
homebrew.taps = [
|
||||||
"exoscale/tap"
|
"exoscale/tap"
|
||||||
|
|
Loading…
Reference in New Issue