nixos-container: introduce hostPort in declarative container options.
This commit is contained in:
parent
a238c8a575
commit
8684285251
@ -131,6 +131,7 @@ let
|
|||||||
--setenv LOCAL_ADDRESS="$LOCAL_ADDRESS" \
|
--setenv LOCAL_ADDRESS="$LOCAL_ADDRESS" \
|
||||||
--setenv HOST_ADDRESS6="$HOST_ADDRESS6" \
|
--setenv HOST_ADDRESS6="$HOST_ADDRESS6" \
|
||||||
--setenv LOCAL_ADDRESS6="$LOCAL_ADDRESS6" \
|
--setenv LOCAL_ADDRESS6="$LOCAL_ADDRESS6" \
|
||||||
|
--setenv HOST_PORT="$HOST_PORT" \
|
||||||
--setenv PATH="$PATH" \
|
--setenv PATH="$PATH" \
|
||||||
${if cfg.additionalCapabilities != null && cfg.additionalCapabilities != [] then
|
${if cfg.additionalCapabilities != null && cfg.additionalCapabilities != [] then
|
||||||
''--capability="${concatStringsSep " " cfg.additionalCapabilities}"'' else ""
|
''--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 {
|
hostAddress = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
@ -654,6 +665,9 @@ in
|
|||||||
${optionalString (cfg.hostBridge != null) ''
|
${optionalString (cfg.hostBridge != null) ''
|
||||||
HOST_BRIDGE=${cfg.hostBridge}
|
HOST_BRIDGE=${cfg.hostBridge}
|
||||||
''}
|
''}
|
||||||
|
${optionalString (cfg.hostPort != null) ''
|
||||||
|
HOST_PORT=${cfg.hostPort}
|
||||||
|
''}
|
||||||
${optionalString (cfg.hostAddress != null) ''
|
${optionalString (cfg.hostAddress != null) ''
|
||||||
HOST_ADDRESS=${cfg.hostAddress}
|
HOST_ADDRESS=${cfg.hostAddress}
|
||||||
''}
|
''}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user