Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman: 1.9.3 -> 2.0.1 #91138

Merged
merged 3 commits into from Jun 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions nixos/modules/virtualisation/containers.nix
Expand Up @@ -34,6 +34,25 @@ in
'';
};

containersConf = mkOption {
default = {};
description = "containers.conf configuration";
type = types.submodule {
options = {

extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration that should be put in the containers.conf
configuration file
'';

};
};
};
};

registries = {
search = mkOption {
type = types.listOf types.str;
Expand Down Expand Up @@ -93,6 +112,12 @@ in

config = lib.mkIf cfg.enable {

environment.etc."containers/containers.conf".text = ''
[network]
cni_plugin_dirs = ["${pkgs.cni-plugins}/bin/"]

'' + cfg.containersConf.extraConfig;

environment.etc."containers/registries.conf".source = toTOML "registries.conf" {
registries = lib.mapAttrs (n: v: { registries = v; }) cfg.registries;
};
Expand Down
28 changes: 4 additions & 24 deletions nixos/modules/virtualisation/podman.nix
Expand Up @@ -28,6 +28,10 @@ let

in
{
imports = [
(lib.mkRenamedOptionModule [ "virtualisation" "podman" "libpod" ] [ "virtualisation" "containers" "containersConf" ])
];

meta = {
maintainers = lib.teams.podman.members;
};
Expand Down Expand Up @@ -67,25 +71,6 @@ in
'';
};

libpod = mkOption {
default = {};
description = "Libpod configuration";
type = types.submodule {
options = {

extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Extra configuration that should be put in the libpod.conf
configuration file
'';

};
};
};
};

package = lib.mkOption {
type = types.package;
default = podmanPackage;
Expand All @@ -103,11 +88,6 @@ in
environment.systemPackages = [ cfg.package ]
++ lib.optional cfg.dockerCompat dockerCompat;

environment.etc."containers/libpod.conf".text = ''
cni_plugin_dir = ["${pkgs.cni-plugins}/bin/"]

'' + cfg.libpod.extraConfig;

environment.etc."cni/net.d/87-podman-bridge.conflist".source = copyFile "${pkgs.podman-unwrapped.src}/cni/87-podman-bridge.conflist";

# Enable common /etc/containers configuration
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/podman.nix
Expand Up @@ -71,7 +71,7 @@ import ./make-test-python.nix (
podman.succeed(su_cmd("tar cv --files-from /dev/null | podman import - scratchimg"))
podman.succeed(
su_cmd(
"podman run --runtime=crun -d --name=sleeping -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg /bin/sleep 10"
"podman run --cgroup-manager=cgroupfs --runtime=crun -d --name=sleeping -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg /bin/sleep 10"
)
)
podman.succeed(su_cmd("podman ps | grep sleeping"))
Expand Down
6 changes: 3 additions & 3 deletions pkgs/applications/virtualization/podman/default.nix
Expand Up @@ -16,13 +16,13 @@

buildGoModule rec {
pname = "podman";
version = "1.9.3";
version = "2.0.1";

src = fetchFromGitHub {
owner = "containers";
repo = "libpod";
rev = "v${version}";
sha256 = "0gbp12xn1vliyawkw2w2bpn6b5h2cm41g3nj72vk4jyhis0igq1s";
sha256 = "11avj4q3xh7qbcbs8h4jis0bdfkvvh193sflwiz8hcp41qjvinz4";
};

vendorSha256 = null;
Expand Down Expand Up @@ -52,7 +52,7 @@ buildGoModule rec {
install -Dm555 bin/podman $out/bin/podman
installShellCompletion --bash completions/bash/podman
installShellCompletion --zsh completions/zsh/_podman
MANDIR=$man/share/man make install.man
MANDIR=$man/share/man make install.man-nobuild
'';

passthru.tests.podman = nixosTests.podman;
Expand Down