diff options
author | LuoChen <luochen1990@gmail.com> | 2022-05-05 16:02:15 +0800 |
---|---|---|
committer | LuoChen <luochen1990@gmail.com> | 2022-05-05 16:08:46 +0800 |
commit | e4b942eccfec761f901a3c7932495cae03ab0809 (patch) | |
tree | e8d1deb03f9aabc8866e9e4c222f78ec90b72e3d | |
parent | 81bcb0a861813386bcb149f18b84ccc01bbfa331 (diff) | |
download | nixpkgs-e4b942eccfec761f901a3c7932495cae03ab0809.tar nixpkgs-e4b942eccfec761f901a3c7932495cae03ab0809.tar.gz nixpkgs-e4b942eccfec761f901a3c7932495cae03ab0809.tar.bz2 nixpkgs-e4b942eccfec761f901a3c7932495cae03ab0809.tar.lz nixpkgs-e4b942eccfec761f901a3c7932495cae03ab0809.tar.xz nixpkgs-e4b942eccfec761f901a3c7932495cae03ab0809.tar.zst nixpkgs-e4b942eccfec761f901a3c7932495cae03ab0809.zip |
wg-quick: fix postUp always generated issue
-rw-r--r-- | nixos/modules/services/networking/wg-quick.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/wg-quick.nix b/nixos/modules/services/networking/wg-quick.nix index 61e9fe5096b..0b3815d0cc6 100644 --- a/nixos/modules/services/networking/wg-quick.nix +++ b/nixos/modules/services/networking/wg-quick.nix @@ -211,7 +211,7 @@ let postUp = optional (values.privateKeyFile != null) "wg set ${name} private-key <(cat ${values.privateKeyFile})" ++ (concatMap (peer: optional (peer.presharedKeyFile != null) "wg set ${name} peer ${peer.publicKey} preshared-key <(cat ${peer.presharedKeyFile})") values.peers) ++ - optional (values.postUp != null) values.postUp; + optional (values.postUp != "") values.postUp; postUpFile = if postUp != [] then writeScriptFile "postUp.sh" (concatMapStringsSep "\n" (line: line) postUp) else null; preDownFile = if values.preDown != "" then writeScriptFile "preDown.sh" values.preDown else null; postDownFile = if values.postDown != "" then writeScriptFile "postDown.sh" values.postDown else null; |