Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions nixos/modules/virtualisation/docker.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Systemd services for docker.

{ config, lib, pkgs, ... }:
{ config, lib, utils, pkgs, ... }:

with lib;

Expand Down Expand Up @@ -271,11 +271,15 @@ in
restartIfChanged = false;
unitConfig.X-StopOnRemoval = false;

serviceConfig.Type = "oneshot";

script = ''
${cfg.package}/bin/docker system prune -f ${toString cfg.autoPrune.flags}
'';
serviceConfig = {
Type = "oneshot";
ExecStart = utils.escapeSystemdExecArgs ([
(lib.getExe cfg.package)
"system"
"prune"
"-f"
] ++ cfg.autoPrune.flags);
};

startAt = optional cfg.autoPrune.enable cfg.autoPrune.dates;
after = [ "docker.service" ];
Expand Down