services.networkd-dispatcher.rules

Declarative configuration of networkd-dispatcher rules. See upstream instructions for an introduction and example scripts.

Type
attribute set of (submodule)
Default
{ }
Example
{ "restart-tor" = {
    onState = ["routable" "off"];
    script = ''
      #!${pkgs.runtimeShell}
      if [[ $IFACE == "wlan0" && $AdministrativeState == "configured" ]]; then
        echo "Restarting Tor ..."
        systemctl restart tor
      fi
      exit 0
    '';
  };
};
Declared
<nixpkgs/nixos/modules/services/networking/networkd-dispatcher.nix>