avoid toplevel python script in nix-store

this will trigger a os.listdir() on the nix-store
This commit is contained in:
Jörg Thalheim 2024-09-03 09:28:12 +02:00
parent db9119b88a
commit 46cd291c60

View file

@ -1,6 +1,6 @@
{ config, lib, modulesPath, pkgs, ... }: { config, lib, modulesPath, pkgs, ... }:
let let
restore-network = pkgs.writers.writePython3 "restore-network" { flakeIgnore = [ "E501" ]; } restore-network = pkgs.writers.writePython3Bin "restore-network" { flakeIgnore = [ "E501" ]; }
./restore_routes.py; ./restore_routes.py;
# does not link with iptables enabled # does not link with iptables enabled
@ -64,7 +64,7 @@ in
Type = "oneshot"; Type = "oneshot";
RemainAfterExit = true; RemainAfterExit = true;
ExecStart = [ ExecStart = [
"${restore-network} /root/network/addrs.json /root/network/routes-v4.json /root/network/routes-v6.json /etc/systemd/network" "${restore-network}/bin/restore-network /root/network/addrs.json /root/network/routes-v4.json /root/network/routes-v6.json /etc/systemd/network"
]; ];
}; };