Skip to content

Commit 41c7225

Browse files
authored
podman: use serviceConfig.ExecStart instead of script (NixOS#390731)
2 parents 6ba10ff + ccdfb91 commit 41c7225

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

nixos/modules/virtualisation/podman/default.nix

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ config, lib, pkgs, ... }:
1+
{ config, lib, utils, pkgs, ... }:
22
let
33
cfg = config.virtualisation.podman;
44
json = pkgs.formats.json { };
@@ -202,11 +202,15 @@ in
202202
restartIfChanged = false;
203203
unitConfig.X-StopOnRemoval = false;
204204

205-
serviceConfig.Type = "oneshot";
206-
207-
script = ''
208-
${cfg.package}/bin/podman system prune -f ${toString cfg.autoPrune.flags}
209-
'';
205+
serviceConfig = {
206+
Type = "oneshot";
207+
ExecStart = utils.escapeSystemdExecArgs ([
208+
(lib.getExe cfg.package)
209+
"system"
210+
"prune"
211+
"-f"
212+
] ++ cfg.autoPrune.flags);
213+
};
210214

211215
startAt = lib.optional cfg.autoPrune.enable cfg.autoPrune.dates;
212216
after = [ "podman.service" ];

0 commit comments

Comments
 (0)