networking.dhcpcd.runHook

NixOS option

Shell code that will be run after all other hooks. See man dhcpcd-run-hooks for details on what is possible. To use sudo or similar tools in your script you may have to set: networking.dhcpcd.allowSetuid = true; In addition, as most of the filesystem is inaccessible to dhcpcd by default, you may want to define some exceptions, e.g. systemd.services.dhcpcd.serviceConfig.ReadOnlyPaths = [ "/run/user/1000/bus" # to send desktop notifications ];

type: strings concatenated with "\n"
Default
""
Example
"if [[ $reason =~ BOUND ]]; then echo $interface: Routers are $new_routers - were $old_routers; fi"
declared in: nixos/modules/services/networking/dhcpcd.nixView source on NixOS/nixpkgs →