Added a way to add arbitrary entries in /etc/hosts .

svn path=/nixos/trunk/; revision=9528
This commit is contained in:
Michael Raskin 2007-10-26 04:49:44 +00:00
parent e4626e0f0d
commit b4be8e3b92
3 changed files with 11 additions and 1 deletions

View File

@ -45,7 +45,10 @@ import ../helpers/make-etc.nix {
}
{ # Hostname-to-IP mappings.
source = ./hosts;
source = pkgs.substituteAll{
src = ./hosts;
extraHosts = config.get ["networking" "extraHosts"];
};
target = "hosts";
}

View File

@ -1 +1,2 @@
127.0.0.1 localhost
@extraHosts@

View File

@ -235,6 +235,12 @@
description = "The name of the machine.";
}
{
name = ["networking" "extraHosts"];
default = "";
example = "192.168.0.1 lanlocalhost";
description = "Pasted verbatim into /etc/hosts.";
}
{
name = ["networking" "useDHCP"];