podman: use serviceConfig.ExecStart instead of script (#390731)

WilliButz 41c72256 6ba10ff2

Changed files
+10 -6
nixos
modules
virtualisation
podman
+10 -6
nixos/modules/virtualisation/podman/default.nix
···
-
{ config, lib, pkgs, ... }:
+
{ config, lib, utils, pkgs, ... }:
let
cfg = config.virtualisation.podman;
json = pkgs.formats.json { };
···
restartIfChanged = false;
unitConfig.X-StopOnRemoval = false;
-
serviceConfig.Type = "oneshot";
-
-
script = ''
-
${cfg.package}/bin/podman system prune -f ${toString cfg.autoPrune.flags}
-
'';
+
serviceConfig = {
+
Type = "oneshot";
+
ExecStart = utils.escapeSystemdExecArgs ([
+
(lib.getExe cfg.package)
+
"system"
+
"prune"
+
"-f"
+
] ++ cfg.autoPrune.flags);
+
};
startAt = lib.optional cfg.autoPrune.enable cfg.autoPrune.dates;
after = [ "podman.service" ];