nixos-container: support bridge.
This commit is contained in:
parent
44c3bfbc10
commit
3490508ed1
|
@ -16,7 +16,7 @@ umask 0022;
|
||||||
sub showHelp {
|
sub showHelp {
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
Usage: nixos-container list
|
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]
|
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 destroy <container-name>
|
nixos-container destroy <container-name>
|
||||||
nixos-container start <container-name>
|
nixos-container start <container-name>
|
||||||
nixos-container stop <container-name>
|
nixos-container stop <container-name>
|
||||||
|
@ -36,6 +36,7 @@ my $systemPath;
|
||||||
my $nixosPath;
|
my $nixosPath;
|
||||||
my $ensureUniqueName = 0;
|
my $ensureUniqueName = 0;
|
||||||
my $autoStart = 0;
|
my $autoStart = 0;
|
||||||
|
my $bridge;
|
||||||
my $extraConfig;
|
my $extraConfig;
|
||||||
my $signal;
|
my $signal;
|
||||||
my $configFile;
|
my $configFile;
|
||||||
|
@ -44,6 +45,7 @@ GetOptions(
|
||||||
"help" => sub { showHelp() },
|
"help" => sub { showHelp() },
|
||||||
"ensure-unique-name" => \$ensureUniqueName,
|
"ensure-unique-name" => \$ensureUniqueName,
|
||||||
"auto-start" => \$autoStart,
|
"auto-start" => \$autoStart,
|
||||||
|
"bridge=s" => \$bridge,
|
||||||
"system-path=s" => \$systemPath,
|
"system-path=s" => \$systemPath,
|
||||||
"signal=s" => \$signal,
|
"signal=s" => \$signal,
|
||||||
"nixos-path=s" => \$nixosPath,
|
"nixos-path=s" => \$nixosPath,
|
||||||
|
@ -153,6 +155,7 @@ if ($action eq "create") {
|
||||||
push @conf, "PRIVATE_NETWORK=1\n";
|
push @conf, "PRIVATE_NETWORK=1\n";
|
||||||
push @conf, "HOST_ADDRESS=$hostAddress\n";
|
push @conf, "HOST_ADDRESS=$hostAddress\n";
|
||||||
push @conf, "LOCAL_ADDRESS=$localAddress\n";
|
push @conf, "LOCAL_ADDRESS=$localAddress\n";
|
||||||
|
push @conf, "HOST_BRIDGE=$bridge\n";
|
||||||
push @conf, "AUTO_START=$autoStart\n";
|
push @conf, "AUTO_START=$autoStart\n";
|
||||||
write_file($confFile, \@conf);
|
write_file($confFile, \@conf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue