mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-20 12:42:24 +00:00
nixos-container: support bridge.
This commit is contained in:
parent
44c3bfbc10
commit
3490508ed1
|
@ -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]
|
||||
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 start <container-name>
|
||||
nixos-container stop <container-name>
|
||||
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue