3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #9395 from bosu/cont-ifaces

containers: add interfaces config option.
This commit is contained in:
lethalman 2015-08-26 10:41:21 +02:00
commit 3aed00d593

View file

@ -120,6 +120,15 @@ in
'';
};
interfaces = mkOption {
type = types.listOf types.string;
default = null;
example = [ "eth1" "eth2" ];
description = ''
The list of interfaces to be moved into the container.
'';
};
autoStart = mkOption {
type = types.bool;
default = false;
@ -218,6 +227,10 @@ in
extraFlags+=" --network-veth"
fi
for iface in $INTERFACES; do
extraFlags+=" --network-interface=$iface"
done
for iface in $MACVLANS; do
extraFlags+=" --network-macvlan=$iface"
done
@ -331,6 +344,9 @@ in
LOCAL_ADDRESS=${cfg.localAddress}
''}
''}
${optionalString (cfg.interfaces != null) ''
INTERFACES="${toString cfg.interfaces}"
''}
${optionalString cfg.autoStart ''
AUTO_START=1
''}