Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions pkgs/by-name/ex/expressvpn/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,21 @@ let
};

expressvpndFHS = buildFHSEnv {
inherit pname version;
inherit version;
pname = "expressvpnd";

# When connected, it directly creates/deletes resolv.conf to change the DNS entries.
# Since it's running in an FHS environment, it has no effect on actual resolv.conf.
# Hence, place a watcher that updates host resolv.conf when FHS resolv.conf changes.

# Mount the host's resolv.conf to the container's /etc/resolv.conf
runScript = writeScript "${pname}-wrapper" ''
cp /host/etc/resolv.conf /etc/resolv.conf;
mkdir -p /host/etc
[ -e /host/etc/resolv.conf ] || touch /host/etc/resolv.conf
mount --bind /etc/resolv.conf /host/etc/resolv.conf
mount -o remount,rw /host/etc/resolv.conf
trap "umount /host/etc/resolv.conf" EXIT

while inotifywait /etc 2>/dev/null;
do
cp /etc/resolv.conf /host/etc/resolv.conf;
Expand Down