diff options
author | Ian-Woo Kim <ianwookim@gmail.com> | 2016-12-02 13:21:03 -0800 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2017-02-15 05:12:46 +0100 |
commit | a238c8a575a0397861e75b9509ded670f9e6381b (patch) | |
tree | 29db8f195581b1573c08ebf724a81cea8156a0c1 /pkgs/tools/virtualization/nixos-container | |
parent | 3490508ed1708a7dad1307a5739665b51df9b34d (diff) |
nixos-container: add --port option for nixos-container (forward network ports to systemd-nspawn container)
Diffstat (limited to 'pkgs/tools/virtualization/nixos-container')
-rwxr-xr-x | pkgs/tools/virtualization/nixos-container/nixos-container.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/tools/virtualization/nixos-container/nixos-container.pl b/pkgs/tools/virtualization/nixos-container/nixos-container.pl index 18ee2f111b41..cde79f8a8208 100755 --- a/pkgs/tools/virtualization/nixos-container/nixos-container.pl +++ b/pkgs/tools/virtualization/nixos-container/nixos-container.pl @@ -16,7 +16,7 @@ umask 0022; sub showHelp { print <<EOF; Usage: nixos-container list - nixos-container create <container-name> [--nixos-path <path>] [--system-path <path>] [--config-file <path>] [--config <string>] [--ensure-unique-name] [--auto-start] [--bridge <iface>] + nixos-container create <container-name> [--nixos-path <path>] [--system-path <path>] [--config-file <path>] [--config <string>] [--ensure-unique-name] [--auto-start] [--bridge <iface>] [--port <port>] nixos-container destroy <container-name> nixos-container start <container-name> nixos-container stop <container-name> @@ -37,6 +37,7 @@ my $nixosPath; my $ensureUniqueName = 0; my $autoStart = 0; my $bridge; +my $port; my $extraConfig; my $signal; my $configFile; @@ -46,6 +47,7 @@ GetOptions( "ensure-unique-name" => \$ensureUniqueName, "auto-start" => \$autoStart, "bridge=s" => \$bridge, + "port=s" => \$port, "system-path=s" => \$systemPath, "signal=s" => \$signal, "nixos-path=s" => \$nixosPath, @@ -156,6 +158,7 @@ if ($action eq "create") { push @conf, "HOST_ADDRESS=$hostAddress\n"; push @conf, "LOCAL_ADDRESS=$localAddress\n"; push @conf, "HOST_BRIDGE=$bridge\n"; + push @conf, "HOST_PORT=$port\n"; push @conf, "AUTO_START=$autoStart\n"; write_file($confFile, \@conf); |