Skip to content

Commit ef2bde5

Browse files
committed
docker: use serviceConfig.ExecStart instead of script
1 parent 403ba18 commit ef2bde5

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

nixos/modules/virtualisation/docker.nix

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Systemd services for docker.
22

3-
{ config, lib, pkgs, ... }:
3+
{ config, lib, utils, pkgs, ... }:
44

55
with lib;
66

@@ -271,11 +271,15 @@ in
271271
restartIfChanged = false;
272272
unitConfig.X-StopOnRemoval = false;
273273

274-
serviceConfig.Type = "oneshot";
275-
276-
script = ''
277-
${cfg.package}/bin/docker system prune -f ${toString cfg.autoPrune.flags}
278-
'';
274+
serviceConfig = {
275+
Type = "oneshot";
276+
ExecStart = utils.escapeSystemdExecArgs ([
277+
(lib.getExe cfg.package)
278+
"system"
279+
"prune"
280+
"-f"
281+
] ++ cfg.autoPrune.flags);
282+
};
279283

280284
startAt = optional cfg.autoPrune.enable cfg.autoPrune.dates;
281285
after = [ "docker.service" ];

0 commit comments

Comments
 (0)