nixos/strongswan-swanctl: link strongswan.conf to /etc
This commit is contained in:
@@ -42,6 +42,7 @@ in {
|
||||
];
|
||||
|
||||
environment.etc."swanctl/swanctl.conf".source = configFile;
|
||||
environment.etc."strongswan.conf".text = cfg.strongswan.extraConfig;
|
||||
|
||||
# The swanctl command complains when the following directories don't exist:
|
||||
# See: https://wiki.strongswan.org/projects/strongswan/wiki/Swanctldirectory
|
||||
@@ -67,14 +68,10 @@ in {
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
path = with pkgs; [ kmod iproute2 iptables util-linux ];
|
||||
environment = {
|
||||
STRONGSWAN_CONF = pkgs.writeTextFile {
|
||||
name = "strongswan.conf";
|
||||
text = cfg.strongswan.extraConfig;
|
||||
};
|
||||
SWANCTL_DIR = "/etc/swanctl";
|
||||
};
|
||||
restartTriggers = [ config.environment.etc."swanctl/swanctl.conf".source ];
|
||||
restartTriggers = [
|
||||
config.environment.etc."swanctl/swanctl.conf".source
|
||||
config.environment.etc."strongswan.conf".source
|
||||
];
|
||||
serviceConfig = {
|
||||
ExecStart = "${cfg.package}/sbin/charon-systemd";
|
||||
Type = "notify";
|
||||
|
||||
Reference in New Issue
Block a user