···11-# buildFHSUserEnv {#sec-fhs-environments}
11+# buildFHSEnv {#sec-fhs-environments}
2233-`buildFHSUserEnv` provides a way to build and run FHS-compatible lightweight sandboxes. It creates an isolated root with bound `/nix/store`, so its footprint in terms of disk space needed is quite small. This allows one to run software which is hard or unfeasible to patch for NixOS -- 3rd-party source trees with FHS assumptions, games distributed as tarballs, software with integrity checking and/or external self-updated binaries. It uses Linux namespaces feature to create temporary lightweight environments which are destroyed after all child processes exit, without root user rights requirement. Accepted arguments are:
33+`buildFHSEnv` provides a way to build and run FHS-compatible lightweight sandboxes. It creates an isolated root with bound `/nix/store`, so its footprint in terms of disk space needed is quite small. This allows one to run software which is hard or unfeasible to patch for NixOS -- 3rd-party source trees with FHS assumptions, games distributed as tarballs, software with integrity checking and/or external self-updated binaries. It uses Linux namespaces feature to create temporary lightweight environments which are destroyed after all child processes exit, without root user rights requirement. Accepted arguments are:
4455- `name`
66 Environment name.
···2626```nix
2727{ pkgs ? import <nixpkgs> {} }:
28282929-(pkgs.buildFHSUserEnv {
2929+(pkgs.buildFHSEnv {
3030 name = "simple-x11-env";
3131 targetPkgs = pkgs: (with pkgs;
3232 [ udev
···9494Then instead of running the AppImage "as-is", run `appimage-run foo.appimage`.
95959696To make other pre-built executables work on NixOS, you need to package them
9797-with Nix and special helpers like `autoPatchelfHook` or `buildFHSUserEnv`. See
9797+with Nix and special helpers like `autoPatchelfHook` or `buildFHSEnv`. See
9898the [Nixpkgs manual](https://nixos.org/nixpkgs/manual) for details. This
9999is complex and often doing a source build is easier.
···2233{ alsa-lib
44, bash
55-, buildFHSUserEnv
55+, buildFHSEnv
66, cacert
77, coreutils
88, dbus
···178178 # Android Studio downloads prebuilt binaries as part of the SDK. These tools
179179 # (e.g. `mksdcard`) have `/lib/ld-linux.so.2` set as the interpreter. An FHS
180180 # environment is used as a work around for that.
181181- fhsEnv = buildFHSUserEnv {
181181+ fhsEnv = buildFHSEnv {
182182 name = "${drvName}-fhs-env";
183183 multiPkgs = pkgs: [
184184 ncurses5
···2222, mkDerivation
2323, xkeyboard_config
2424, fetchurl
2525-, buildFHSUserEnv
2525+, buildFHSEnv
2626, openal
2727, makeDesktopItem
2828}:
···9494in
95959696# We can patch the "/bin/superposition", but "/bin/launcher" checks it for changes.
9797-# For that we need use a buildFHSUserEnv.
9797+# For that we need use a buildFHSEnv.
98989999-buildFHSUserEnv {
9999+buildFHSEnv {
100100 name = "Superposition";
101101102102 targetPkgs = pkgs: [
···11{ autoPatchelfHook
22-, buildFHSUserEnv
22+, buildFHSEnv
33, dpkg
44, fetchurl
55, inotify-tools
···4141 '';
4242 };
43434444- expressvpndFHS = buildFHSUserEnv {
4444+ expressvpndFHS = buildFHSEnv {
4545 name = "expressvpnd";
46464747 # When connected, it directly creates/deletes resolv.conf to change the DNS entries.
+1-1
pkgs/applications/networking/pcloud/default.nix
···33# of applications.
44#
55# What Nix does, simplifying a bit, is that it extracts an AppImage and starts
66-# it via buildFHSUserEnv - this is totally fine for majority of apps, but makes
66+# it via buildFHSEnv - this is totally fine for majority of apps, but makes
77# it by-design *impossible* to launch SUID wrappers [^1]; in case of pCloud,
88# it's fusermount.
99# (so pCloud starts, but silently fails to mount the FUSE drive.)
···11-{ lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSUserEnv, installShellFiles }:
11+{ lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSEnv, installShellFiles }:
2233let
44···48484949in
5050if stdenv.isLinux then
5151-# buildFHSUserEnv is needed because the arduino-cli downloads compiler
5151+# buildFHSEnv is needed because the arduino-cli downloads compiler
5252# toolchains from the internet that have their interpreters pointed at
5353# /lib64/ld-linux-x86-64.so.2
5454- buildFHSUserEnv
5454+ buildFHSEnv
5555 {
5656 inherit (pkg) name meta;
5757
···94949595 # no tests in PyPI dist
9696 # run into https://stackoverflow.com/questions/51203641/attributeerror-module-alembic-context-has-no-attribute-config
9797- # also, tests use conda so can't run on NixOS without buildFHSUserEnv
9797+ # also, tests use conda so can't run on NixOS without buildFHSEnv
9898 doCheck = false;
9999100100 meta = with lib; {
···11-{ stdenvNoCC, lib, fetchurl, buildFHSUserEnv }:
11+{ stdenvNoCC, lib, fetchurl, buildFHSEnv }:
2233let
44 version = "2.3";
···2020 };
21212222 # FHS env, as patchelf will not work
2323- env = buildFHSUserEnv {
2323+ env = buildFHSEnv {
2424 name = "left4gore-env-${version}";
2525 targetPkgs = _: [ left4gore-unwrapped ];
2626 runScript = "left4gore";
+3-3
pkgs/games/runescape-launcher/default.nix
···11{ stdenv
22, lib
33, autoPatchelfHook
44-, buildFHSUserEnv
44+, buildFHSEnv
55, cairo
66, dpkg
77, fetchurl
···109109110110 /*
111111 * We can patch the runescape launcher, but it downloads a client at runtime and checks it for changes.
112112- * For that we need use a buildFHSUserEnv.
112112+ * For that we need use a buildFHSEnv.
113113 * FHS simulates a classic linux shell
114114 */
115115- buildFHSUserEnv {
115115+ buildFHSEnv {
116116 name = "RuneScape";
117117 targetPkgs = pkgs: [
118118 runescape
···11# The actual Plex package that we run is a FHS userenv of the "raw" package.
22{ stdenv
33-, buildFHSUserEnvBubblewrap
33+, buildFHSEnv
44, writeScript
55, plexRaw
66···99, dataDir ? "/var/lib/plex"
1010}:
11111212-buildFHSUserEnvBubblewrap {
1212+buildFHSEnv {
1313 name = "plexmediaserver";
14141515 inherit (plexRaw) meta;