mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
commit
a8efeed583
4 changed files with 33 additions and 28 deletions
|
@ -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 = {
|
registries = {
|
||||||
search = mkOption {
|
search = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
|
@ -93,6 +112,12 @@ in
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
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" {
|
environment.etc."containers/registries.conf".source = toTOML "registries.conf" {
|
||||||
registries = lib.mapAttrs (n: v: { registries = v; }) cfg.registries;
|
registries = lib.mapAttrs (n: v: { registries = v; }) cfg.registries;
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,6 +28,10 @@ let
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
(lib.mkRenamedOptionModule [ "virtualisation" "podman" "libpod" ] [ "virtualisation" "containers" "containersConf" ])
|
||||||
|
];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
maintainers = lib.teams.podman.members;
|
maintainers = lib.teams.podman.members;
|
||||||
};
|
};
|
||||||
|
@ -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 {
|
package = lib.mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = podmanPackage;
|
default = podmanPackage;
|
||||||
|
@ -103,11 +88,6 @@ in
|
||||||
environment.systemPackages = [ cfg.package ]
|
environment.systemPackages = [ cfg.package ]
|
||||||
++ lib.optional cfg.dockerCompat dockerCompat;
|
++ 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";
|
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
|
# Enable common /etc/containers configuration
|
||||||
|
|
|
@ -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("tar cv --files-from /dev/null | podman import - scratchimg"))
|
||||||
podman.succeed(
|
podman.succeed(
|
||||||
su_cmd(
|
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"))
|
podman.succeed(su_cmd("podman ps | grep sleeping"))
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
|
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
pname = "podman";
|
pname = "podman";
|
||||||
version = "1.9.3";
|
version = "2.0.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "containers";
|
owner = "containers";
|
||||||
repo = "libpod";
|
repo = "libpod";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "0gbp12xn1vliyawkw2w2bpn6b5h2cm41g3nj72vk4jyhis0igq1s";
|
sha256 = "11avj4q3xh7qbcbs8h4jis0bdfkvvh193sflwiz8hcp41qjvinz4";
|
||||||
};
|
};
|
||||||
|
|
||||||
vendorSha256 = null;
|
vendorSha256 = null;
|
||||||
|
@ -52,7 +52,7 @@ buildGoModule rec {
|
||||||
install -Dm555 bin/podman $out/bin/podman
|
install -Dm555 bin/podman $out/bin/podman
|
||||||
installShellCompletion --bash completions/bash/podman
|
installShellCompletion --bash completions/bash/podman
|
||||||
installShellCompletion --zsh completions/zsh/_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;
|
passthru.tests.podman = nixosTests.podman;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue