Merge pull request #96690 from NinjaTrappeur/nin-networkd-test-fix-flakiness

nixosTests.systemd-networkd: fix test flakiness
This commit is contained in:
Maximilian Bosch 2020-08-30 21:32:57 +02:00 committed by GitHub
commit 3e65f88623
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,16 +7,17 @@ let generateNodeConf = { lib, pkgs, config, privk, pubk, peerId, nodeId, ...}: {
virtualisation.vlans = [ 1 ];
environment.systemPackages = with pkgs; [ wireguard-tools ];
boot.extraModulePackages = [ config.boot.kernelPackages.wireguard ];
systemd.tmpfiles.rules = [
"f /run/wg_priv 0640 root systemd-network - ${privk}"
];
systemd.network = {
enable = true;
netdevs = {
"90-wg0" = {
netdevConfig = { Kind = "wireguard"; Name = "wg0"; };
wireguardConfig = {
PrivateKeyFile = "/run/wg_priv";
# NOTE: we're storing the wireguard private key in the
# store for this test. Do not do this in the real
# world. Keep in mind the nix store is
# world-readable.
PrivateKeyFile = pkgs.writeText "wg0-priv" privk;
ListenPort = 51820;
FirewallMark = 42;
};