networking: Restore the original /etc/hosts on activation
A patch that replaced the original file with a symlink to nix store was reverted because MacOS Network framework doesn't support symlinks for the file. The revert leaves the system without any /etc/hosts file at all though. To fix this, an activation step is added to restore the original file from .before-nix-darwin backup, if it exists. Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This commit is contained in:
parent
1d9f622484
commit
b1db30ce36
1 changed files with 5 additions and 0 deletions
|
|
@ -132,6 +132,11 @@ in
|
|||
${optionalString (cfg.wakeOnLan.enable != null) ''
|
||||
systemsetup -setWakeOnNetworkAccess '${onOff cfg.wakeOnLan.enable}' &> /dev/null
|
||||
''}
|
||||
|
||||
if [ -e /etc/hosts.before-nix-darwin ]; then
|
||||
echo "restoring /etc/hosts..." >&2
|
||||
sudo mv /etc/hosts{.before-nix-darwin,}
|
||||
fi
|
||||
'';
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue