summary refs log tree commit diff
path: root/nixos/modules/services/networking/dhcpcd.nix
diff options
context:
space:
mode:
authorWout Mertens <Wout.Mertens@gmail.com>2014-05-12 15:03:42 +0200
committerWout Mertens <Wout.Mertens@gmail.com>2014-05-12 15:03:42 +0200
commitc927cee2c3ad9b205a18535301a9ca7a3c484c95 (patch)
tree14aadec91bcb3c96476c47bdabccd63a9c59943e /nixos/modules/services/networking/dhcpcd.nix
parent7d3dcd9a8c36bf33314a664c9d7c90b7ef4d73dd (diff)
downloadnixpkgs-c927cee2c3ad9b205a18535301a9ca7a3c484c95.tar
nixpkgs-c927cee2c3ad9b205a18535301a9ca7a3c484c95.tar.gz
nixpkgs-c927cee2c3ad9b205a18535301a9ca7a3c484c95.tar.bz2
nixpkgs-c927cee2c3ad9b205a18535301a9ca7a3c484c95.tar.lz
nixpkgs-c927cee2c3ad9b205a18535301a9ca7a3c484c95.tar.xz
nixpkgs-c927cee2c3ad9b205a18535301a9ca7a3c484c95.tar.zst
nixpkgs-c927cee2c3ad9b205a18535301a9ca7a3c484c95.zip
dhcpcd: Allow adding hook code
Diffstat (limited to 'nixos/modules/services/networking/dhcpcd.nix')
-rw-r--r--nixos/modules/services/networking/dhcpcd.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/dhcpcd.nix b/nixos/modules/services/networking/dhcpcd.nix
index 8799d7d8a20..5a353fc0942 100644
--- a/nixos/modules/services/networking/dhcpcd.nix
+++ b/nixos/modules/services/networking/dhcpcd.nix
@@ -57,6 +57,8 @@ let
       #if [ "$reason" = EXPIRE -o "$reason" = RELEASE -o "$reason" = NOCARRIER ] ; then
       #    ${config.systemd.package}/bin/systemctl start ip-down.target
       #fi
+
+      ${config.networking.dhcpcd.runHook}
     '';
 
 in
@@ -86,6 +88,16 @@ in
       '';
     };
 
+    networking.dhcpcd.runHook = mkOption {
+      type = types.lines;
+      default = "";
+      example = "if [[ $reason =~ BOUND ]]; then echo $interface: Routers are $new_routers - were $old_routers; fi";
+      description = ''
+         Shell code that will be run after all other hooks. See
+         `man dhcpcd-run-hooks` for details on what is possible.
+      '';
+    };
+
   };