summary refs log tree commit diff
path: root/nixos/tests/wireguard
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2023-02-13 10:34:28 +0100
committerpennae <82953136+pennae@users.noreply.github.com>2023-02-16 11:56:12 +0100
commit047bd73c5e05e8f60abb0ea2a3b22c845404f9cd (patch)
treedf1416a80c219fb89f5b0e8e54e975050640ded2 /nixos/tests/wireguard
parentf080d59315e4f0eaf45ef7b3aa8136c21c549fee (diff)
downloadnixpkgs-047bd73c5e05e8f60abb0ea2a3b22c845404f9cd.tar
nixpkgs-047bd73c5e05e8f60abb0ea2a3b22c845404f9cd.tar.gz
nixpkgs-047bd73c5e05e8f60abb0ea2a3b22c845404f9cd.tar.bz2
nixpkgs-047bd73c5e05e8f60abb0ea2a3b22c845404f9cd.tar.lz
nixpkgs-047bd73c5e05e8f60abb0ea2a3b22c845404f9cd.tar.xz
nixpkgs-047bd73c5e05e8f60abb0ea2a3b22c845404f9cd.tar.zst
nixpkgs-047bd73c5e05e8f60abb0ea2a3b22c845404f9cd.zip
nixos/wireguard: make publicKeys singleLineStrs
using readFile instead of fileContents (or using indented strings) can
leave a trailing newline that causes build errors in systemd units and
has previously caused runtime errors in wireguard scripts. use
singleLineStr to strip a trailing newline if it exists, and to fail if
more than one is present.
Diffstat (limited to 'nixos/tests/wireguard')
-rw-r--r--nixos/tests/wireguard/snakeoil-keys.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/tests/wireguard/snakeoil-keys.nix b/nixos/tests/wireguard/snakeoil-keys.nix
index 55ad582d405..c979f0e0c8a 100644
--- a/nixos/tests/wireguard/snakeoil-keys.nix
+++ b/nixos/tests/wireguard/snakeoil-keys.nix
@@ -6,6 +6,7 @@
 
   peer1 = {
     privateKey = "uO8JVo/sanx2DOM0L9GUEtzKZ82RGkRnYgpaYc7iXmg=";
-    publicKey = "Ks9yRJIi/0vYgRmn14mIOQRwkcUGBujYINbMpik2SBI=";
+    # readFile'd keys may have trailing newlines, emulate this
+    publicKey = "Ks9yRJIi/0vYgRmn14mIOQRwkcUGBujYINbMpik2SBI=\n";
   };
 }