Commit 047bd73c authored by pennae's avatar pennae Committed by pennae
Browse files

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.
parent f080d593
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ let

      publicKey = mkOption {
        example = "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=";
        type = types.str;
        type = types.singleLineStr;
        description = lib.mdDoc "The base64 public key of the peer.";
      };

+2 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@

  peer1 = {
    privateKey = "uO8JVo/sanx2DOM0L9GUEtzKZ82RGkRnYgpaYc7iXmg=";
    publicKey = "Ks9yRJIi/0vYgRmn14mIOQRwkcUGBujYINbMpik2SBI=";
    # readFile'd keys may have trailing newlines, emulate this
    publicKey = "Ks9yRJIi/0vYgRmn14mIOQRwkcUGBujYINbMpik2SBI=\n";
  };
}