nixos/podman: Introduce new option extraRuntimes

This disables the hard, not overridable, dependency on `runc`.
It also sharpens the description of `extraPackages` to highlight the
difference between those options.

Fixes #443274.
This commit is contained in:
René Neumann
2025-09-18 14:19:18 +02:00
parent 1bc4de0728
commit c26558c5cc
+26 -16
View File
@@ -103,13 +103,24 @@ in
extraPackages = mkOption {
type = with types; listOf package;
default = [ ];
description = ''
Extra dependencies for podman to be placed on $PATH in the wrapper.
'';
};
extraRuntimes = mkOption {
type = with types; listOf package;
# keep the default in sync with the podman package
default = lib.optionals pkgs.stdenv.hostPlatform.isLinux [ pkgs.runc ];
defaultText = lib.literalExpression ''lib.optionals pkgs.stdenv.hostPlatform.isLinux [ pkgs.runc ]'';
example = lib.literalExpression ''
[
pkgs.gvisor
]
'';
description = ''
Extra packages to be installed in the Podman wrapper.
Extra runtime packages to be installed in the Podman wrapper.
Those are then placed in libexec/podman, i.e. are seen as podman internal commands.
'';
};
@@ -161,21 +172,20 @@ in
config.systemd.package # To allow systemd-based container healthchecks
]
++ lib.optional (config.boot.supportedFilesystems.zfs or false) config.boot.zfs.package;
extraRuntimes = [
pkgs.runc
]
++
lib.optionals
(
config.virtualisation.containers.containersConf.settings.network.default_rootless_network_cmd or ""
== "slirp4netns"
)
(
with pkgs;
[
slirp4netns
]
);
extraRuntimes =
cfg.extraRuntimes
++
lib.optionals
(
config.virtualisation.containers.containersConf.settings.network.default_rootless_network_cmd or ""
== "slirp4netns"
)
(
with pkgs;
[
slirp4netns
]
);
};
};