diff options
author | adisbladis <adisbladis@gmail.com> | 2020-04-28 21:27:18 +0100 |
---|---|---|
committer | adisbladis <adisbladis@gmail.com> | 2020-04-29 11:53:06 +0100 |
commit | 78cba5ac1e0883f939766523927205f7a722fa5c (patch) | |
tree | b356399637a6c113a2f1cf4db198af8a38da8d6b /nixos/modules | |
parent | b2a9a3e9cbe3eadb613161d88bd407f797ce270e (diff) |
nixos.podman: Expose extraPackages from the podman wrapper
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/virtualisation/podman.nix | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/nixos/modules/virtualisation/podman.nix b/nixos/modules/virtualisation/podman.nix index 57c9c07df45b..815d0778ae74 100644 --- a/nixos/modules/virtualisation/podman.nix +++ b/nixos/modules/virtualisation/podman.nix @@ -4,18 +4,20 @@ let inherit (lib) mkOption types; + podmanPackage = (pkgs.podman.override { inherit (cfg) extraPackages; }); + # Provides a fake "docker" binary mapping to podman - dockerCompat = pkgs.runCommandNoCC "${pkgs.podman.pname}-docker-compat-${pkgs.podman.version}" { + dockerCompat = pkgs.runCommandNoCC "${podmanPackage.pname}-docker-compat-${podmanPackage.version}" { outputs = [ "out" "bin" "man" ]; - inherit (pkgs.podman) meta; + inherit (podmanPackage) meta; } '' mkdir $out mkdir -p $bin/bin - ln -s ${pkgs.podman.bin}/bin/podman $bin/bin/docker + ln -s ${podmanPackage.bin}/bin/podman $bin/bin/docker mkdir -p $man/share/man/man1 - for f in ${pkgs.podman.man}/share/man/man1/*; do + for f in ${podmanPackage.man}/share/man/man1/*; do basename=$(basename $f | sed s/podman/docker/g) ln -s $f $man/share/man/man1/$basename done @@ -54,6 +56,19 @@ in ''; }; + extraPackages = mkOption { + type = with types; listOf package; + default = [ ]; + example = lib.literalExample '' + [ + pkgs.gvisor + ] + ''; + description = '' + Extra packages to be installed in the Podman wrapper. + ''; + }; + libpod = mkOption { default = {}; description = "Libpod configuration"; @@ -77,12 +92,11 @@ in config = lib.mkIf cfg.enable { - environment.systemPackages = [ pkgs.podman ] + environment.systemPackages = [ podmanPackage ] ++ lib.optional cfg.dockerCompat dockerCompat; environment.etc."containers/libpod.conf".text = '' cni_plugin_dir = ["${pkgs.cni-plugins}/bin/"] - cni_config_dir = "/etc/cni/net.d/" '' + cfg.libpod.extraConfig; |