diff options
author | Naïm Favier <n@monade.li> | 2022-03-29 21:18:46 +0200 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2022-06-21 22:58:44 +0200 |
commit | 458ac47a1d5491dfb610cb8faaffcf5d5445b224 (patch) | |
tree | 891942ea8798e5a745a395fdfeced3ff88876ad5 /nixos/tests/wireguard | |
parent | fd662e5c4657f451d1fa534fccdc61aebba841ca (diff) | |
download | nixpkgs-458ac47a1d5491dfb610cb8faaffcf5d5445b224.tar nixpkgs-458ac47a1d5491dfb610cb8faaffcf5d5445b224.tar.gz nixpkgs-458ac47a1d5491dfb610cb8faaffcf5d5445b224.tar.bz2 nixpkgs-458ac47a1d5491dfb610cb8faaffcf5d5445b224.tar.lz nixpkgs-458ac47a1d5491dfb610cb8faaffcf5d5445b224.tar.xz nixpkgs-458ac47a1d5491dfb610cb8faaffcf5d5445b224.tar.zst nixpkgs-458ac47a1d5491dfb610cb8faaffcf5d5445b224.zip |
nixos/wg-quick: improve usage with systemd-networkd
Use `networking.resolvconf.package` to allow DNS entries to be set using the system-wide resolver implementation instead of hardcoding systemd or openresolv. Extend the tests by adding DNS entries and making one of the peers use systemd-networkd (hence systemd-resolved). Also add a few `networkd`-specific settings.
Diffstat (limited to 'nixos/tests/wireguard')
-rw-r--r-- | nixos/tests/wireguard/wg-quick.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/tests/wireguard/wg-quick.nix b/nixos/tests/wireguard/wg-quick.nix index 961c2e15c30..bc2cba91188 100644 --- a/nixos/tests/wireguard/wg-quick.nix +++ b/nixos/tests/wireguard/wg-quick.nix @@ -29,6 +29,8 @@ import ../make-test-python.nix ({ pkgs, lib, ... }: inherit (wg-snakeoil-keys.peer1) publicKey; }; + + dns = [ "10.23.42.2" "fc00::2" "wg0" ]; }; }; }; @@ -38,6 +40,7 @@ import ../make-test-python.nix ({ pkgs, lib, ... }: ip6 = "fd00::2"; extraConfig = { boot = lib.mkIf (kernelPackages != null) { inherit kernelPackages; }; + networking.useNetworkd = true; networking.wg-quick.interfaces.wg0 = { address = [ "10.23.42.2/32" "fc00::2/128" ]; inherit (wg-snakeoil-keys.peer1) privateKey; @@ -49,6 +52,8 @@ import ../make-test-python.nix ({ pkgs, lib, ... }: inherit (wg-snakeoil-keys.peer0) publicKey; }; + + dns = [ "10.23.42.1" "fc00::1" "wg0" ]; }; }; }; |