Skip to content

Commit

Permalink
nixos/strongswan-swanctl: link strongswan.conf to /etc
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCao committed Dec 6, 2024
1 parent fec7473 commit b04e5d7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions nixos/modules/services/networking/strongswan-swanctl/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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";
Expand Down

0 comments on commit b04e5d7

Please sign in to comment.