-
-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #939 from ibizaman/networking_hosts
Add networking.hosts and .hostFiles from nixos
- Loading branch information
Showing
5 changed files
with
109 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
doc/known-files/c7dd0e2ed261ce76d76f852596c5b54026b9a894fa481381ffd399b556c0e2da
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## | ||
# Host Database | ||
# | ||
# localhost is used to configure the loopback interface | ||
# when the system is booting. Do not change this entry. | ||
## | ||
127.0.0.1 localhost | ||
255.255.255.255 broadcasthost | ||
::1 localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ config, pkgs, ... }: | ||
|
||
{ | ||
networking.hosts = { | ||
"127.0.0.1" = [ "my.super.host" ]; | ||
"10.0.0.1" = [ "my.super.host" "my.other.host" ]; | ||
}; | ||
|
||
test = '' | ||
set -v | ||
echo checking /etc/hosts file >&2 | ||
file=${config.out}/etc/hosts | ||
grep '127.0.0.1' $file | head -n1 | grep localhost$ | ||
grep '127.0.0.1' $file | tail -n1 | grep my.super.host$ | ||
grep '::1' $file | grep localhost$ | ||
grep '10.0.0.1' $file | grep my.super.host\ my.other.host$ | ||
''; | ||
} |