1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-22 08:10:11 +00:00
nix-darwin/tests/networking-hosts.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
470 B
Nix
Raw Normal View History

{ 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$
'';
}