about summary refs log tree commit diff
path: root/pkgs/tools/networking/strongswan
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2017-01-14 20:41:51 +0100
committerFranz Pletz <fpletz@fnordicwalking.de>2017-01-14 20:41:51 +0100
commitf0338024b9278b44ff97bc86778d4fd618401df8 (patch)
treec1bd4c3444acaba34aad309566e709e09d3d3c62 /pkgs/tools/networking/strongswan
parent666810cd25d7309f609a5c40231b52b8848b4222 (diff)
downloadnixlib-f0338024b9278b44ff97bc86778d4fd618401df8.tar
nixlib-f0338024b9278b44ff97bc86778d4fd618401df8.tar.gz
nixlib-f0338024b9278b44ff97bc86778d4fd618401df8.tar.bz2
nixlib-f0338024b9278b44ff97bc86778d4fd618401df8.tar.lz
nixlib-f0338024b9278b44ff97bc86778d4fd618401df8.tar.xz
nixlib-f0338024b9278b44ff97bc86778d4fd618401df8.tar.zst
nixlib-f0338024b9278b44ff97bc86778d4fd618401df8.zip
strongswan: enable charon-systemd (#21872)
See: https://wiki.strongswan.org/projects/strongswan/wiki/Charon-systemd
Diffstat (limited to 'pkgs/tools/networking/strongswan')
-rw-r--r--pkgs/tools/networking/strongswan/default.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/pkgs/tools/networking/strongswan/default.nix b/pkgs/tools/networking/strongswan/default.nix
index 7bcbb4fddb6b..7da47e339d08 100644
--- a/pkgs/tools/networking/strongswan/default.nix
+++ b/pkgs/tools/networking/strongswan/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, gmp, pkgconfig, python, autoreconfHook
 , curl, trousers, sqlite, iptables, libxml2, openresolv
-, ldns, unbound, pcsclite, openssl
+, ldns, unbound, pcsclite, openssl, systemd
 , enableTNC ? false }:
 
 stdenv.mkDerivation rec {
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   dontPatchELF = true;
 
   buildInputs =
-    [ gmp pkgconfig python autoreconfHook iptables ldns unbound openssl pcsclite ]
+    [ gmp pkgconfig python autoreconfHook iptables ldns unbound openssl pcsclite systemd.dev ]
     ++ stdenv.lib.optionals enableTNC [ curl trousers sqlite libxml2 ];
 
   patches = [
@@ -26,10 +26,21 @@ stdenv.mkDerivation rec {
 
   postPatch = ''
     substituteInPlace src/libcharon/plugins/resolve/resolve_handler.c --replace "/sbin/resolvconf" "${openresolv}/sbin/resolvconf"
+
+    # swanctl can be configured by files in SWANCTLDIR which defaults to
+    # $out/etc/swanctl. Since that directory is in the nix store users can't
+    # modify it. Ideally swanctl accepts a command line option for specifying
+    # the configuration files. In the absence of that we patch swanctl to look
+    # for configuration files in /etc/swanctl.
+    substituteInPlace src/swanctl/swanctl.h --replace "SWANCTLDIR" "\"/etc/swanctl\""
     '';
 
+  preConfigure = ''
+    configureFlagsArray+=("--with-systemdsystemunitdir=$out/etc/systemd/system")
+  '';
+
   configureFlags =
-    [ "--enable-swanctl" "--enable-cmd"
+    [ "--enable-swanctl" "--enable-cmd" "--enable-systemd"
       "--enable-farp" "--enable-dhcp"
       "--enable-eap-sim" "--enable-eap-sim-file" "--enable-eap-simaka-pseudonym"
       "--enable-eap-simaka-reauth" "--enable-eap-identity" "--enable-eap-md5"