summary refs log tree commit diff
path: root/nixos/modules/services/networking/dhcpcd.nix
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2014-06-12 23:34:40 +0000
committerMichael Raskin <7c6f434c@mail.ru>2014-09-01 10:33:48 +0400
commit8c9b6d932a7b8ce5feca240abbe8b2232c699b05 (patch)
treef0bbea07cd035fdb20844b5ace6ad03fdfac1d1a /nixos/modules/services/networking/dhcpcd.nix
parent99243a5c514c888e09bbc13214a6ba23ea03d392 (diff)
downloadnixpkgs-8c9b6d932a7b8ce5feca240abbe8b2232c699b05.tar
nixpkgs-8c9b6d932a7b8ce5feca240abbe8b2232c699b05.tar.gz
nixpkgs-8c9b6d932a7b8ce5feca240abbe8b2232c699b05.tar.bz2
nixpkgs-8c9b6d932a7b8ce5feca240abbe8b2232c699b05.tar.lz
nixpkgs-8c9b6d932a7b8ce5feca240abbe8b2232c699b05.tar.xz
nixpkgs-8c9b6d932a7b8ce5feca240abbe8b2232c699b05.tar.zst
nixpkgs-8c9b6d932a7b8ce5feca240abbe8b2232c699b05.zip
nixos: add dhcpcd.persistent option
Diffstat (limited to 'nixos/modules/services/networking/dhcpcd.nix')
-rw-r--r--nixos/modules/services/networking/dhcpcd.nix16
1 files changed, 14 insertions, 2 deletions
diff --git a/nixos/modules/services/networking/dhcpcd.nix b/nixos/modules/services/networking/dhcpcd.nix
index 89aa9bdb6b6..09c271bfbfb 100644
--- a/nixos/modules/services/networking/dhcpcd.nix
+++ b/nixos/modules/services/networking/dhcpcd.nix
@@ -64,7 +64,7 @@ let
       #    ${config.systemd.package}/bin/systemctl start ip-down.target
       #fi
 
-      ${config.networking.dhcpcd.runHook}
+      ${cfg.runHook}
     '';
 
 in
@@ -75,6 +75,18 @@ in
 
   options = {
 
+    networking.dhcpcd.persistent = mkOption {
+      type = types.bool;
+      default = false;
+      description = ''
+          Whenever to leave interfaces configured on dhcpcd daemon
+          shutdown. Set to true if you have your root or store mounted
+          over the network or this machine accepts SSH connections
+          through DHCP interfaces and clients should be notified when
+          it shuts down.
+      '';
+    };
+
     networking.dhcpcd.denyInterfaces = mkOption {
       type = types.listOf types.str;
       default = [];
@@ -139,7 +151,7 @@ in
         serviceConfig =
           { Type = "forking";
             PIDFile = "/run/dhcpcd.pid";
-            ExecStart = "@${dhcpcd}/sbin/dhcpcd dhcpcd --quiet --config ${dhcpcdConf}";
+            ExecStart = "@${dhcpcd}/sbin/dhcpcd dhcpcd --quiet ${optionalString cfg.persistent "--persistent"} --config ${dhcpcdConf}";
             ExecReload = "${dhcpcd}/sbin/dhcpcd --rebind";
             Restart = "always";
           };