storage: automatically cleanup old files
This commit is contained in:
parent
edeab9f843
commit
27cc126d4a
|
@ -44,6 +44,7 @@
|
||||||
services.flatpak.enable = true;
|
services.flatpak.enable = true;
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
virtualisation.docker.autoPrune.enable = true;
|
virtualisation.docker.autoPrune.enable = true;
|
||||||
|
virtualisation.docker.autoPrune.flags = [ "--all --volumes" ];
|
||||||
programs.firejail.enable = true;
|
programs.firejail.enable = true;
|
||||||
|
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
|
|
|
@ -181,6 +181,26 @@
|
||||||
exec nicotine
|
exec nicotine
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
systemd.user.services.rm-target = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Remove directories named 'target'";
|
||||||
|
};
|
||||||
|
Service = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = pkgs.writeShellScript "rm-target" ''
|
||||||
|
sudo ${pkgs.fd}/bin/fd -td -u '^\.?target$' "$HOME" -x rm -vrf --
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.user.timers.rm-target = {
|
||||||
|
Unit = { Description = "Remove directories named 'target'"; };
|
||||||
|
Timer = {
|
||||||
|
OnCalendar = "weekly";
|
||||||
|
Unit = "rm-target.service";
|
||||||
|
};
|
||||||
|
Install = { WantedBy = [ "timers.target" ]; };
|
||||||
|
};
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
# when a new Home Manager release introduces backwards
|
# when a new Home Manager release introduces backwards
|
||||||
|
|
Loading…
Reference in a new issue