Skip to content

Commit 4fd49d8

Browse files
committed
checks/iperf: perform network configuration with systemd-networkd
for it being less dependending on interface names
1 parent ae015fd commit 4fd49d8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

checks/iperf.nix

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ nixpkgs.lib.optionalAttrs (builtins.elem hypervisor self.lib.hypervisorsWithNetw
66
name = "vm-${hypervisor}-iperf";
77
nodes.vm = {
88
imports = [ self.nixosModules.host ];
9+
# TODO: this is a farce of a flake. replace with declarative
10+
# microvm.
911
microvm.vms."${hypervisor}-iperf-server".flake = nixpkgs.legacyPackages.${system}.runCommand "${hypervisor}-iperf-server.flake" {
1012
passthru.nixosConfigurations."${hypervisor}-iperf-server" = nixpkgs.lib.nixosSystem {
1113
inherit system;
@@ -21,16 +23,14 @@ nixpkgs.lib.optionalAttrs (builtins.elem hypervisor self.lib.hypervisorsWithNetw
2123
} ];
2224
};
2325
networking.hostName = "${hypervisor}-microvm";
24-
networking = {
25-
interfaces.eth0 = {
26-
useDHCP = false;
27-
ipv4.addresses = [ {
28-
address = "10.0.0.1";
29-
prefixLength = 24;
30-
} ];
26+
systemd.network = {
27+
enable = true;
28+
networks."10-eth" = {
29+
matchConfig.Type = "ether";
30+
address = [ "10.0.0.1/24" ];
3131
};
32-
firewall.enable = false;
3332
};
33+
networking.firewall.enable = false;
3434
services.iperf3.enable = true;
3535
}
3636
];

0 commit comments

Comments
 (0)