summary refs log tree commit diff
path: root/modules/tasks/network-interfaces.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2010-09-14 11:58:55 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2010-09-14 11:58:55 +0000
commit5b3fd663ed04f9c6fa87dac755df6c7e0b8520a9 (patch)
tree994b566bf80185bfbe032455158248299ba58c78 /modules/tasks/network-interfaces.nix
parent071b192c9d48984c78aec75c05251eeeaa5e2d1e (diff)
downloadnixpkgs-5b3fd663ed04f9c6fa87dac755df6c7e0b8520a9.tar
nixpkgs-5b3fd663ed04f9c6fa87dac755df6c7e0b8520a9.tar.gz
nixpkgs-5b3fd663ed04f9c6fa87dac755df6c7e0b8520a9.tar.bz2
nixpkgs-5b3fd663ed04f9c6fa87dac755df6c7e0b8520a9.tar.lz
nixpkgs-5b3fd663ed04f9c6fa87dac755df6c7e0b8520a9.tar.xz
nixpkgs-5b3fd663ed04f9c6fa87dac755df6c7e0b8520a9.tar.zst
nixpkgs-5b3fd663ed04f9c6fa87dac755df6c7e0b8520a9.zip
* Don't set hostname to "", dhclient no longer needs it.
svn path=/nixos/trunk/; revision=23783
Diffstat (limited to 'modules/tasks/network-interfaces.nix')
-rw-r--r--modules/tasks/network-interfaces.nix9
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/tasks/network-interfaces.nix b/modules/tasks/network-interfaces.nix
index 2e1514a82cf..562a945d832 100644
--- a/modules/tasks/network-interfaces.nix
+++ b/modules/tasks/network-interfaces.nix
@@ -211,14 +211,9 @@ in
     # it's not configured in the NixOS configuration, since it may
     # have been set by dhclient in the meantime.
     system.activationScripts.hostname =
-      (if config.networking.hostName != "" then ''
+      optionalString (config.networking.hostName != "") ''
         hostname "${config.networking.hostName}"
-      '' else ''
-        # dhclient won't do anything if the hostname isn't empty.
-        if test "$(hostname)" = "(none)"; then
-          hostname ""
-        fi
-      '');
+      '';
 
   };