about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2023-12-16 10:04:09 +0300
committerK900 <me@0upti.me>2023-12-16 10:04:09 +0300
commit5eb4128d60a43b12f4daeabb645666b48fdab817 (patch)
tree49edab53df4cea00fc760e2998219a0e2010af74 /pkgs/build-support
parentbe1866d6989ca0cb7a203499f34912c958d06c78 (diff)
buildFHSEnv: propagate host /etc if nested
This fixes use cases like launching Lutris/Heroic from Steam.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/build-fhsenv-bubblewrap/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix
index b6b5f13bba978..7d0138a4d85a2 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