From 5c0d4439e8a4843284360fcdea39c9f682f33a60 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 10 Sep 2021 23:33:31 +0200 Subject: [PATCH] =?UTF-8?q?bwrap-helper:=20Reuse=20system=E2=80=99s=20PATH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise running in nix-shell does not make the binaries from the temporary environment available inside the sandbox. --- pkgs/bwrap-helper/bwrap-helper.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pkgs/bwrap-helper/bwrap-helper.py b/pkgs/bwrap-helper/bwrap-helper.py index 9d509b9..6954f84 100755 --- a/pkgs/bwrap-helper/bwrap-helper.py +++ b/pkgs/bwrap-helper/bwrap-helper.py @@ -72,11 +72,6 @@ uid = os.getuid() gid = os.getgid() home = os.getenv("HOME") -path_entries = [ - f"/etc/profiles/per-user/{username}/bin", - "/run/current-system/sw/bin", -] - argument_groups = { "base": ( True, @@ -111,11 +106,13 @@ argument_groups = { "path": ( True, [ - *flat_map(ro_bind_try, path_entries), - *setenv("PATH", ":".join(path_entries)), - *ro_bind_try( - "/run/current-system/sw" - ), # not really path, but also libraries etc. + *flat_map( + ro_bind, + [ + "/run/current-system/sw", # not exclusive to path, but also libraries etc. + f"/etc/profiles/per-user/{username}/bin", + ], + ), ], ), "gui": (