mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-26 08:48:38 +03:00
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.
This commit is contained in:
parent
f080d59315
commit
047bd73c5e
@ -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.";
|
||||
};
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
peer1 = {
|
||||
privateKey = "uO8JVo/sanx2DOM0L9GUEtzKZ82RGkRnYgpaYc7iXmg=";
|
||||
publicKey = "Ks9yRJIi/0vYgRmn14mIOQRwkcUGBujYINbMpik2SBI=";
|
||||
# readFile'd keys may have trailing newlines, emulate this
|
||||
publicKey = "Ks9yRJIi/0vYgRmn14mIOQRwkcUGBujYINbMpik2SBI=\n";
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user