Use path instead of export in nftables service on blowhole

Signed-off-by: magic_rb <richard@brezak.sk>
This commit is contained in:
magic_rb 2023-10-07 22:47:29 +02:00
parent ca4775b49e
commit 52d2b22844
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -262,11 +262,13 @@ in
};
systemd.services.nftables = {
path = with pkgs; [
nftables iptables bash
];
serviceConfig =
let
rulesScript = pkgs.writeShellScript "nftables-rules" ''
set -ex
export PATH=${pkgs.nftables}/bin:${pkgs.iptables}/bin:${pkgs.bash}/bin:$PATH
tmpfile="$(mktemp)"
iptables-save -t filter >> $tmpfile
@ -289,7 +291,6 @@ in
ExecReload = mkForce rulesScript;
ExecStop = mkForce (pkgs.writeShellScript "nftables-flush" ''
set -ex
export PATH=${pkgs.nftables}/bin:${pkgs.iptables}/bin:${pkgs.bash}/bin:$PATH
tmpfile="$(mktemp)"
iptables-save -t filter >> $tmpfile