From 3490508ed1708a7dad1307a5739665b51df9b34d Mon Sep 17 00:00:00 2001 From: Ian-Woo Kim Date: Sun, 27 Nov 2016 02:37:50 -0800 Subject: [PATCH] nixos-container: support bridge. --- pkgs/tools/virtualization/nixos-container/nixos-container.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/virtualization/nixos-container/nixos-container.pl b/pkgs/tools/virtualization/nixos-container/nixos-container.pl index 5cb7e3b560b8..18ee2f111b41 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 < [--nixos-path ] [--system-path ] [--config-file ] [--config ] [--ensure-unique-name] [--auto-start] + nixos-container create [--nixos-path ] [--system-path ] [--config-file ] [--config ] [--ensure-unique-name] [--auto-start] [--bridge ] nixos-container destroy nixos-container start nixos-container stop @@ -36,6 +36,7 @@ my $systemPath; my $nixosPath; my $ensureUniqueName = 0; my $autoStart = 0; +my $bridge; my $extraConfig; my $signal; my $configFile; @@ -44,6 +45,7 @@ GetOptions( "help" => sub { showHelp() }, "ensure-unique-name" => \$ensureUniqueName, "auto-start" => \$autoStart, + "bridge=s" => \$bridge, "system-path=s" => \$systemPath, "signal=s" => \$signal, "nixos-path=s" => \$nixosPath, @@ -153,6 +155,7 @@ if ($action eq "create") { push @conf, "PRIVATE_NETWORK=1\n"; push @conf, "HOST_ADDRESS=$hostAddress\n"; push @conf, "LOCAL_ADDRESS=$localAddress\n"; + push @conf, "HOST_BRIDGE=$bridge\n"; push @conf, "AUTO_START=$autoStart\n"; write_file($confFile, \@conf);