diff --git a/hosts/docker/configuration.nix b/hosts/docker/configuration.nix index d92a7d4..bffcb15 100644 --- a/hosts/docker/configuration.nix +++ b/hosts/docker/configuration.nix @@ -119,6 +119,25 @@ systemd.timers.nextcloud = { }; }; +# Create nextcloud cron scheduled task +systemd.services.docker-prune = { + description = "Prune docker data"; + script = ''${pkgs.docker} system prune --volumes --all''; + serviceConfig = { + Type = "oneshot"; + User = "nixos"; + }; + path = with pkgs; [ docker docker-compose ]; +}; + +systemd.timers.docker-prune = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "monthly"; + Persistent = true; + }; +}; + # create update task # systemd.services.update-containers = {