about summary refs log tree commit diff
path: root/pkgs/build-support/build-fhsenv-bubblewrap
AgeCommit message (Collapse)AuthorFilesLines
2024-06-20buildFHSEnv: export GST_PLUGIN_SYSTEM_PATH_1_0Martino Fontana1-0/+4
GStreamer searches for plugins relative to its binary's location. However, since https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/bd97973ce0f2c5495bcda5cccd4f7ef7dcb7febc, it uses its *real* binary location, breaking the FHS. Fixes #311004 (tested on Heroic and Lutris too).
2024-05-16buildFHSEnvBubblewrap: allow more varied $DISPLAY syntaxThomas Watson1-2/+4
The $DISPLAY variable has a format of [host]:num[.screen]. Previously, the number would only be extracted properly if it had the form :num. Allow all forms but correctly discard the unused parts.
2024-04-24buildFHSEnvBubblewrap/buildFHSEnv: permit pname+version instead of namePeder Bergebakken Sundt2-4/+7
2024-04-24buildFHSEnvBubblewrap: do not infer `pname` from `name`Peder Bergebakken Sundt1-12/+9
2024-04-07build-fhsenv-bubblewrap: reference 32-bit binaries only if multiArchThomas Watson2-8/+7
Fixes issues using bubblewrap'd fhsenvs in scenarios where i686 is not supported (such as Rosetta 2 emulation in a Linux VM on Apple Silicon).
2024-03-25Merge remote-tracking branch 'upstream/master' into staging-nextannalee1-1/+9
2024-03-19Avoid top-level `with ...;` in ↵Philip Taron1-15/+25
pkgs/build-support/build-fhsenv-bubblewrap/default.nix
2024-03-10build-fhsenv-bubblewrap: fix fhsenv etc entrieshellwolf1-1/+9
* added more comments. * symlink fhsenv etc entries when necessary.
2024-02-22Merge pull request #277494 from trofi/buildFHSEnv-fix-evalSandro1-1/+1
2024-01-23buildFHSEnv: don't export `multiPaths` attributeSergei Trofimovich1-1/+1
`multiPaths` is defined via invalid operation on `null` value for non-multilib environments. Noticed on `notesnook` evan failure as: nix-repl> notesnook.fhsenv.multiPaths 253| passthru = { 254| inherit args baseTargetPaths targetPaths baseMultiPaths multiPaths ldconfig; | ^ 255| }; error: attempt to call something which is not a function but null The change makes `multiPaths` a private variable.
2024-01-09buildFHSEnv: bind dbus session bus into place when privateTmp enabled (#278917)Jeff Huffman1-1/+15
2023-12-21buildFHSEnv: fix privateTmp for sddmJeff Huffman1-0/+6
2023-12-16buildFHSEnv: propagate host /etc if nestedK9001-1/+7
This fixes use cases like launching Lutris/Heroic from Steam.
2023-12-13buildFHSEnv, steam: isolate steam's /tmp from hostJeff Huffman1-3/+7
Works around steam's misbehavior: https://github.com/ValveSoftware/steam-for-linux/issues/9121
2023-12-13buildFHSEnv: use symlinks instead of bind mounts for files from host /etcJeff Huffman1-4/+3
Closes #247065
2023-11-12buildFHSenv: fixup /etc permissionsArthur Gautier1-0/+1
when bubblewraps tries to link all the required files in etc from the host to the fhs environment, it will re-create the /etc directory. It will do so with `0700` permissions. This causes permissions issues with non-root programs when they need to access configuration in the environment /etc. By mounting /etc as a tmpfs early, bwrap will make the directory `0755` as expected.
2023-10-24build-fhsenv-bubblewrap: remove /usr/lib and /usr/lib32 from LD_LIBRARY_PATHLuna Nova1-1/+1
See https://github.com/NixOS/nixpkgs/issues/262775
2023-10-06buildFHSEnvBubblewrap: preserve pname, versionBjørn Forsman1-0/+1
It's useful to have access to these attributes from packages built with buildFHSEnvBubblewrap, and it reduces the difference between FHS and non-FHS packages. 'name' is already handled by runCommandLocal.
2023-10-01Merge pull request #257122 from bjornfor/fix-buildfhsenv-pnameWeijia Wang1-1/+1
buildFHSEnvBubblewrap: allow being passed 'pname'
2023-09-24buildFHSEnvBubblewrap: allow being passed 'pname'Bjørn Forsman1-1/+1
`buildFHSEnvBubblewrap { pname = ...; }` currently results in eval error because args.name doesn't exist then. Fix it by only using args.name if it exists.
2023-09-24buildFHSEnv: add base paths to passthruAlyssa Ross1-5/+5
It's useful to be able to introspect all packages which are available in the fhsenv. I've renamed basePkgs and baseMultiPkgs to be consistent with the naming scheme used for the bits that were previously public — names ending in "Pkgs" are for functions, and names ending in "Paths" are the results of those functions.
2023-09-08buildFHSEnv: disable security features by defaultrnhmjoj1-5/+5
The implicit contract of buildFHSUserEnv was that it allows to run software built for a typical GNU/Linux distribution (not NixOS) without patching it (patchelf, autoPatchelfHook, etc.). Note that this does not inherently imply running untrusted programs. buildFHSUserEnv was implemented by using chroot and assembling a standard-compliant FHS environment in the new root. As expected, this did not provide any kind of isolation between the system and the programs. However, when it was later reimplemented using bubblewrap (PR #225748), which *is* a security tool, several isolation features involving detaches Linux namespaces were turned on by default. This decision has introduced a number of breakages that are very difficult to debug and trace back to this change. For example: `unshareIPC` breaks software audio mixing in programs using ALSA (dmix) and `unsharePID` breaks gdb, Since: 1. the security features were enable without any clear threat model; 2. `buildFHSEnvBubblewrap` is supposed to be a drop-in replacement of `buildFHSEnvChrootenv` (see the release notes for NixOS 23.05); 3. the change is breaking in several common cases (security does not come for free); 4. the contract was not changed, or at least communicated in a clear way to the users; all security features should be turned off by default. P.S. It would be useful to create a variant of buildFHSEnv that does provide some isolation. This could unshare some namespaces and mount only limited parts of the filesystem. Note that buildFHSEnv mounts every directory in / under the new root, so again, very little is gained by unsharing alone.
2023-08-21buildFHSEnv: fix `NIX_LDFLAGS` propagation to `ld` wrapperSergei Trofimovich1-0/+1
Before the change the following command did not work: $ nix develop -i --impure --expr 'with import <nixpkgs> { system = "i686-linux"; }; (buildFHSUserEnv { name = "t"; targetPkgs = ps: with ps; [ libmpc stdenv.cc ]; }).env' $ ld -lmpc -o a ld: cannot find -lmpc: No such file or directory It is expected to work as `NIX_LDFLAGS` does contain valid values: $ echo $NIX_LDFLAGS -L/usr/lib -L/usr/lib32 Note that for `gcc` it does work: $ printf "int main(){}" | gcc -x c - -lmpc -o a It happens because `HOST` role is enabled for `cc`: $ echo $NIX_CC_WRAPPER_TARGET_HOST_i686_unknown_linux_gnu 1 But not for `BINTOOLS`: $ echo $NIX_BINTOOLS_WRAPPER_TARGET_HOST_i686_unknown_linux_gnu <empty> The change adds BINTOOLS role and fixes linking: $ nix develop -i --impure --expr 'with import ~/nm { system = "i686-linux"; }; (buildFHSUserEnv { name = "t"; targetPkgs = ps: with ps; [ libmpc stdenv.cc ]; }).env' $ printf "int main(){}" | gcc -x c - -lmpc -o a $ ld -lmpc -o a ld: warning: cannot find entry symbol _start; not setting start address
2023-07-07buildFHSEnv: disable multiArch by defaultAtemu1-1/+1
Most FHSEnv-wrapped packages in Nixpkgs wrap a x86_64-linux binary; making multiArch unnecessary bloat closure size. Saves about 1G in anki-bin. This makes multiArch FHSEnvs the exception rather than the rule.
2023-07-01buildFHSEnv: add multiArch flagAtemu1-2/+3
The intention is to allow the user control over whether 32bit deps are supposed to be included in the fhsenv
2023-07-01buildFHSEnv: cleanupAtemu1-23/+44
2023-05-22Revert "Merge pull request #230693 from Atemu/fix/fhsenv-escape-runScript-path"Atemu1-1/+1
This reverts commit 840f2e0ac566862d93aff6721351fc09977c1f54, reversing changes made to d3ed0402e50852342ec06edfe4bd23f597d5ae2a. This breaks appimage which puts args into the runScript and we don't provide a good way to pass thru additional args. The actual bug was in nix-alien which should escape paths; providing a valid runScript is the responsibility of the caller.
2023-05-18Merge pull request #230693 from Atemu/fix/fhsenv-escape-runScript-pathAtemu1-1/+1
buildFHSEnvBubblewrap: escape runScript path
2023-05-11buildFHSEnvBubblewrap: escape runScript pathAtemu1-1/+1
Fixes https://github.com/NixOS/nixpkgs/issues/230651 Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
2023-05-08buildFHSEnv: use default values as fallback for XDG_DATA_DIRSlelgenio1-0/+13
2023-04-22buildFHSEnv: restrict pkgsi686Linux to x86_64-linuxWeijia Wang2-1/+5
2023-04-16tree-wide: buildFHSUserEnv -> buildFHSEnvAtemu2-0/+467