diff options
author | Ian-Woo Kim <ianwookim@gmail.com> | 2016-12-02 13:49:38 -0800 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2017-02-15 05:12:46 +0100 |
commit | 86842852513a8e0132e5580802b0fa1d90ef5f9b (patch) | |
tree | a96b6212cca46e81f697ae3aac16d97a509c13c3 /nixos/modules/virtualisation/containers.nix | |
parent | a238c8a575a0397861e75b9509ded670f9e6381b (diff) | |
download | nixpkgs-86842852513a8e0132e5580802b0fa1d90ef5f9b.tar nixpkgs-86842852513a8e0132e5580802b0fa1d90ef5f9b.tar.gz nixpkgs-86842852513a8e0132e5580802b0fa1d90ef5f9b.tar.bz2 nixpkgs-86842852513a8e0132e5580802b0fa1d90ef5f9b.tar.lz nixpkgs-86842852513a8e0132e5580802b0fa1d90ef5f9b.tar.xz nixpkgs-86842852513a8e0132e5580802b0fa1d90ef5f9b.tar.zst nixpkgs-86842852513a8e0132e5580802b0fa1d90ef5f9b.zip |
nixos-container: introduce hostPort in declarative container options.
Diffstat (limited to 'nixos/modules/virtualisation/containers.nix')
-rw-r--r-- | nixos/modules/virtualisation/containers.nix | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index 7193029d451..88273545c2b 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -131,6 +131,7 @@ let --setenv LOCAL_ADDRESS="$LOCAL_ADDRESS" \ --setenv HOST_ADDRESS6="$HOST_ADDRESS6" \ --setenv LOCAL_ADDRESS6="$LOCAL_ADDRESS6" \ + --setenv HOST_PORT="$HOST_PORT" \ --setenv PATH="$PATH" \ ${if cfg.additionalCapabilities != null && cfg.additionalCapabilities != [] then ''--capability="${concatStringsSep " " cfg.additionalCapabilities}"'' else "" @@ -318,6 +319,16 @@ let ''; }; + hostPort = mkOption { + type = types.nullOr types.string; + default = null; + example = "8080"; + description = '' + Allow port forwarding from the host to the container. + ''; + }; + + hostAddress = mkOption { type = types.nullOr types.str; default = null; @@ -654,6 +665,9 @@ in ${optionalString (cfg.hostBridge != null) '' HOST_BRIDGE=${cfg.hostBridge} ''} + ${optionalString (cfg.hostPort != null) '' + HOST_PORT=${cfg.hostPort} + ''} ${optionalString (cfg.hostAddress != null) '' HOST_ADDRESS=${cfg.hostAddress} ''} |