diff --git a/nixos/tests/libreswan.nix b/nixos/tests/libreswan.nix index ff3d2344a679..aadba941fab1 100644 --- a/nixos/tests/libreswan.nix +++ b/nixos/tests/libreswan.nix @@ -107,6 +107,8 @@ in with subtest("Network is up"): alice.wait_until_succeeds("ping -c1 bob") + alice.succeed("systemctl restart ipsec") + bob.succeed("systemctl restart ipsec") with subtest("Eve can eavesdrop cleartext traffic"): eavesdrop() diff --git a/pkgs/tools/networking/libreswan/default.nix b/pkgs/tools/networking/libreswan/default.nix index 47838f756635..a8e0dccdd2bb 100644 --- a/pkgs/tools/networking/libreswan/default.nix +++ b/pkgs/tools/networking/libreswan/default.nix @@ -89,6 +89,11 @@ stdenv.mkDerivation rec { -e 's|systemd-tmpfiles|true|g' \ -i initsystems/systemd/Makefile + # Fix systemd detection on NixOS + sed -e 's|\(-a ! -x /bin/journalctl\)|\1 -a ! -x /run/current-system/sw/bin/journalctl|g' \ + -e 's|\(-o ! -x /bin/journalctl\)|\1 -o ! -x /run/current-system/sw/bin/journalctl|g' \ + -i programs/barf/barf.in + # Fix the ipsec program from crushing the PATH sed -e 's|\(PATH=".*"\):.*$|\1:$PATH|' -i programs/ipsec/ipsec.in