From 81042e810ffb4bf03dce3af532c1bd9eb47de069 Mon Sep 17 00:00:00 2001 From: Nikola Knezevic Date: Fri, 8 Mar 2019 14:16:15 +0100 Subject: [PATCH 1/2] strongswan: 5.7.1 -> 5.7.2 --- pkgs/tools/networking/strongswan/default.nix | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/networking/strongswan/default.nix b/pkgs/tools/networking/strongswan/default.nix index d5b3a00c733e..ff276c0d18a1 100644 --- a/pkgs/tools/networking/strongswan/default.nix +++ b/pkgs/tools/networking/strongswan/default.nix @@ -19,11 +19,11 @@ with stdenv.lib; stdenv.mkDerivation rec { name = "strongswan-${version}"; - version = "5.7.1"; + version = "5.7.2"; src = fetchurl { url = "https://download.strongswan.org/${name}.tar.bz2"; - sha256 = "1v2b8lnqrkbc9hx3p2rw36xvphdy5ayy3dblm3kz98p24s8rqvq0"; + sha256 = "0w6cks42lvvyj5ivyhqyqxya48x93yzfpz281q3xmqicdskkp3ih"; }; dontPatchELF = true; @@ -49,14 +49,7 @@ stdenv.mkDerivation rec { })) ]; - postPatch = '' - # 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\"" - '' + optionalString stdenv.isLinux '' + postPatch = optionalString stdenv.isLinux '' # glibc-2.26 reorganized internal includes sed '1i#include ' -i src/libstrongswan/utils/utils/memory.h From e44e2455d3d55e4825c7fa0ca7178f6218761266 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Fri, 8 Mar 2019 15:59:21 +0100 Subject: [PATCH 2/2] strongswan-swanctl: fix module by setting the new SWANCTL_DIR envvar --- .../services/networking/strongswan-swanctl/module.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/networking/strongswan-swanctl/module.nix b/nixos/modules/services/networking/strongswan-swanctl/module.nix index d770094960b2..817b5ec55f78 100644 --- a/nixos/modules/services/networking/strongswan-swanctl/module.nix +++ b/nixos/modules/services/networking/strongswan-swanctl/module.nix @@ -65,9 +65,12 @@ in { after = [ "network-online.target" "keys.target" ]; wants = [ "keys.target" ]; path = with pkgs; [ kmod iproute iptables utillinux ]; - environment.STRONGSWAN_CONF = pkgs.writeTextFile { - name = "strongswan.conf"; - text = cfg.strongswan.extraConfig; + environment = { + STRONGSWAN_CONF = pkgs.writeTextFile { + name = "strongswan.conf"; + text = cfg.strongswan.extraConfig; + }; + SWANCTL_DIR = "/etc/swanctl"; }; restartTriggers = [ config.environment.etc."swanctl/swanctl.conf".source ]; serviceConfig = {