38 # Tools needed by ipsec scripts
39 binPath = lib.makeBinPath [
40 iproute2 iptables procps
46 stdenv.mkDerivation rec {
51 url = "https://download.libreswan.org/${pname}-${version}.tar.gz";
52 hash = "sha256-HO6dQSyJeZ64v3EUUA1cFOAUPpVGBWFj7r45YOf0Y3w=";
69 gnused gawk gmp unbound pam libevent
70 libcap_ng libxcrypt curl nspr nss ldns
71 # needed to patch shebangs
73 ] ++ lib.optional stdenv.hostPlatform.isLinux libselinux;
76 # Replace wget with curl to save a dependency
77 substituteInPlace programs/letsencrypt/letsencrypt.in \
78 --replace-fail 'wget -q -P' '${curl}/bin/curl -s --remote-name-all --output-dir'
84 "SYSTEMUNITDIR=$(out)/etc/systemd/system/"
85 "TMPFILESDIR=$(out)/lib/tmpfiles.d/"
87 "DEFAULT_DNSSEC_ROOTKEY_FILE=${dns-root-data}/root.key"
90 # Hack to make install work
93 "SYSCONFDIR=\${out}/etc"
97 # Install letsencrypt config files
98 install -m644 -Dt "$out/share/doc/libreswan/letsencrypt" docs/examples/*
102 # Add a PATH to the main "ipsec" script
103 sed -e '0,/^$/{s||export PATH=${binPath}:$PATH|}' \
107 passthru.tests = { inherit (nixosTests) libreswan libreswan-nat; };
110 homepage = "https://libreswan.org";
111 description = "Free software implementation of the VPN protocol based on IPSec and the Internet Key Exchange";
112 platforms = platforms.linux ++ platforms.freebsd;
113 license = with licenses; [ gpl2Plus mpl20 ] ;
114 maintainers = with maintainers; [ afranchuk rnhmjoj ];
115 mainProgram = "ipsec";