boot.initrd.network: Support DHCP

This allows us to use it for EC2 instances.
This commit is contained in:
Eelco Dolstra
2016-02-02 19:59:27 +01:00
parent 901163c0c7
commit cc925d0506
5 changed files with 88 additions and 48 deletions
+22
View File
@@ -0,0 +1,22 @@
import ./make-test.nix ({ pkgs, ...} : {
name = "initrd-network";
meta.maintainers = [ pkgs.stdenv.lib.maintainers.eelco ];
machine = { config, pkgs, ... }: {
imports = [ ../modules/profiles/minimal.nix ];
boot.initrd.network.enable = true;
boot.initrd.network.postCommands =
''
ip addr | grep 10.0.2.15 || exit 1
ping -c1 10.0.2.2 || exit 1
'';
};
testScript =
''
startAll;
$machine->waitForUnit("multi-user.target");
$machine->succeed("ip link >&2");
'';
})