From 5eb4128d60a43b12f4daeabb645666b48fdab817 Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 16 Dec 2023 10:04:09 +0300 Subject: [PATCH] buildFHSEnv: propagate host /etc if nested This fixes use cases like launching Lutris/Heroic from Steam. --- pkgs/build-support/build-fhsenv-bubblewrap/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix index b6b5f13bba97..7d0138a4d85a 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix @@ -149,6 +149,13 @@ let done fi + # propagate /etc from the actual host if nested + if [[ -e /.host-etc ]]; then + ro_mounts+=(--ro-bind /.host-etc /.host-etc) + else + ro_mounts+=(--ro-bind /etc /.host-etc) + fi + for i in ${lib.escapeShellArgs etcBindEntries}; do if [[ "''${etc_ignored[@]}" =~ "$i" ]]; then continue @@ -193,7 +200,6 @@ let ${lib.optionalString unshareCgroup "--unshare-cgroup"} ${lib.optionalString dieWithParent "--die-with-parent"} --ro-bind /nix /nix - --ro-bind /etc /.host-etc ${lib.optionalString privateTmp "--tmpfs /tmp"} # Our glibc will look for the cache in its own path in `/nix/store`. # As such, we need a cache to exist there, because pressure-vessel