tree-wide: buildFHSUserEnv -> buildFHSEnv

This commit is contained in:
Atemu 2023-04-11 12:52:27 +02:00
parent 1baab4e14a
commit f63a12f296
60 changed files with 114 additions and 110 deletions

View file

@ -1,6 +1,6 @@
# buildFHSUserEnv {#sec-fhs-environments} # buildFHSEnv {#sec-fhs-environments}
`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: `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:
- `name` - `name`
Environment name. Environment name.
@ -26,7 +26,7 @@ One can create a simple environment using a `shell.nix` like that:
```nix ```nix
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> {} }:
(pkgs.buildFHSUserEnv { (pkgs.buildFHSEnv {
name = "simple-x11-env"; name = "simple-x11-env";
targetPkgs = pkgs: (with pkgs; targetPkgs = pkgs: (with pkgs;
[ udev [ udev

View file

@ -94,6 +94,6 @@ environment.systemPackages = [ pkgs.appimage-run ];
Then instead of running the AppImage "as-is", run `appimage-run foo.appimage`. Then instead of running the AppImage "as-is", run `appimage-run foo.appimage`.
To make other pre-built executables work on NixOS, you need to package them To make other pre-built executables work on NixOS, you need to package them
with Nix and special helpers like `autoPatchelfHook` or `buildFHSUserEnv`. See with Nix and special helpers like `autoPatchelfHook` or `buildFHSEnv`. See
the [Nixpkgs manual](https://nixos.org/nixpkgs/manual) for details. This the [Nixpkgs manual](https://nixos.org/nixpkgs/manual) for details. This
is complex and often doing a source build is easier. is complex and often doing a source build is easier.

View file

@ -6,7 +6,7 @@ let
cfg = config.services.boinc; cfg = config.services.boinc;
allowRemoteGuiRpcFlag = optionalString cfg.allowRemoteGuiRpc "--allow_remote_gui_rpc"; allowRemoteGuiRpcFlag = optionalString cfg.allowRemoteGuiRpc "--allow_remote_gui_rpc";
fhsEnv = pkgs.buildFHSUserEnv { fhsEnv = pkgs.buildFHSEnv {
name = "boinc-fhs-env"; name = "boinc-fhs-env";
targetPkgs = pkgs': [ cfg.package ] ++ cfg.extraEnvPackages; targetPkgs = pkgs': [ cfg.package ] ++ cfg.extraEnvPackages;
runScript = "/bin/boinc_client"; runScript = "/bin/boinc_client";

View file

@ -1,9 +1,9 @@
{ lib { lib
, buildFHSUserEnv , buildFHSEnv
, sparrow-unwrapped , sparrow-unwrapped
}: }:
buildFHSUserEnv { buildFHSEnv {
name = "sparrow"; name = "sparrow";
runScript = "${sparrow-unwrapped}/bin/sparrow"; runScript = "${sparrow-unwrapped}/bin/sparrow";

View file

@ -2,7 +2,7 @@
{ alsa-lib { alsa-lib
, bash , bash
, buildFHSUserEnv , buildFHSEnv
, cacert , cacert
, coreutils , coreutils
, dbus , dbus
@ -178,7 +178,7 @@ let
# Android Studio downloads prebuilt binaries as part of the SDK. These tools # Android Studio downloads prebuilt binaries as part of the SDK. These tools
# (e.g. `mksdcard`) have `/lib/ld-linux.so.2` set as the interpreter. An FHS # (e.g. `mksdcard`) have `/lib/ld-linux.so.2` set as the interpreter. An FHS
# environment is used as a work around for that. # environment is used as a work around for that.
fhsEnv = buildFHSUserEnv { fhsEnv = buildFHSEnv {
name = "${drvName}-fhs-env"; name = "${drvName}-fhs-env";
multiPkgs = pkgs: [ multiPkgs = pkgs: [
ncurses5 ncurses5

View file

@ -1,4 +1,4 @@
{ callPackage, makeFontsConf, gnome2, buildFHSUserEnv, tiling_wm ? false }: { callPackage, makeFontsConf, gnome2, buildFHSEnv, tiling_wm ? false }:
let let
mkStudio = opts: callPackage (import ./common.nix opts) { mkStudio = opts: callPackage (import ./common.nix opts) {
@ -6,7 +6,7 @@ let
fontDirectories = []; fontDirectories = [];
}; };
inherit (gnome2) GConf gnome_vfs; inherit (gnome2) GConf gnome_vfs;
inherit buildFHSUserEnv; inherit buildFHSEnv;
inherit tiling_wm; inherit tiling_wm;
}; };
stableVersion = { stableVersion = {

View file

@ -1,4 +1,4 @@
{ stdenv, lib, buildFHSUserEnv, callPackage, makeDesktopItem, writeScript { stdenv, lib, buildFHSEnv, callPackage, makeDesktopItem, writeScript
, supportedDevices ? [ "Arria II" "Cyclone V" "Cyclone IV" "Cyclone 10 LP" "MAX II/V" "MAX 10 FPGA" ] , supportedDevices ? [ "Arria II" "Cyclone V" "Cyclone IV" "Cyclone 10 LP" "MAX II/V" "MAX 10 FPGA" ]
, unwrapped ? callPackage ./quartus.nix { inherit supportedDevices; } , unwrapped ? callPackage ./quartus.nix { inherit supportedDevices; }
}: }:
@ -13,7 +13,7 @@ let
categories = [ "Development" ]; categories = [ "Development" ];
}; };
# I think modelsim_ase/linux/vlm checksums itself, so use FHSUserEnv instead of `patchelf` # I think modelsim_ase/linux/vlm checksums itself, so use FHSUserEnv instead of `patchelf`
in buildFHSUserEnv rec { in buildFHSEnv rec {
name = "quartus-prime-lite"; # wrapped name = "quartus-prime-lite"; # wrapped
targetPkgs = pkgs: with pkgs; [ targetPkgs = pkgs: with pkgs; [

View file

@ -1,7 +1,7 @@
{ stdenv, lib, makeDesktopItem { stdenv, lib, makeDesktopItem
, unzip, libsecret, libXScrnSaver, libxshmfence, buildPackages , unzip, libsecret, libXScrnSaver, libxshmfence, buildPackages
, atomEnv, at-spi2-atk, autoPatchelfHook , atomEnv, at-spi2-atk, autoPatchelfHook
, systemd, fontconfig, libdbusmenu, glib, buildFHSUserEnvBubblewrap, wayland , systemd, fontconfig, libdbusmenu, glib, buildFHSEnvBubblewrap, wayland
# Populate passthru.tests # Populate passthru.tests
, tests , tests
@ -150,9 +150,9 @@ let
# in order to create or update extensions. # in order to create or update extensions.
# See: #83288 #91179 #73810 #41189 # See: #83288 #91179 #73810 #41189
# #
# buildFHSUserEnv allows for users to use the existing vscode # buildFHSEnv allows for users to use the existing vscode
# extension tooling without significant pain. # extension tooling without significant pain.
fhs = { additionalPkgs ? pkgs: [] }: buildFHSUserEnvBubblewrap { fhs = { additionalPkgs ? pkgs: [] }: buildFHSEnvBubblewrap {
# also determines the name of the wrapped command # also determines the name of the wrapped command
name = executableName; name = executableName;

View file

@ -22,7 +22,7 @@
, mkDerivation , mkDerivation
, xkeyboard_config , xkeyboard_config
, fetchurl , fetchurl
, buildFHSUserEnv , buildFHSEnv
, openal , openal
, makeDesktopItem , makeDesktopItem
}: }:
@ -94,9 +94,9 @@ let
in in
# We can patch the "/bin/superposition", but "/bin/launcher" checks it for changes. # We can patch the "/bin/superposition", but "/bin/launcher" checks it for changes.
# For that we need use a buildFHSUserEnv. # For that we need use a buildFHSEnv.
buildFHSUserEnv { buildFHSEnv {
name = "Superposition"; name = "Superposition";
targetPkgs = pkgs: [ targetPkgs = pkgs: [

View file

@ -1,5 +1,5 @@
{ lib { lib
, buildFHSUserEnvBubblewrap , buildFHSEnvBubblewrap
, symlinkJoin , symlinkJoin
, bottles-unwrapped , bottles-unwrapped
, gst_all_1 , gst_all_1
@ -99,8 +99,8 @@ in
symlinkJoin { symlinkJoin {
name = "bottles"; name = "bottles";
paths = [ paths = [
(buildFHSUserEnvBubblewrap (fhsEnv // { name = "bottles"; runScript = "bottles"; })) (buildFHSEnvBubblewrap (fhsEnv // { name = "bottles"; runScript = "bottles"; }))
(buildFHSUserEnvBubblewrap (fhsEnv // { name = "bottles-cli"; runScript = "bottles-cli"; })) (buildFHSEnvBubblewrap (fhsEnv // { name = "bottles-cli"; runScript = "bottles-cli"; }))
]; ];
postBuild = '' postBuild = ''
mkdir -p $out/share mkdir -p $out/share

View file

@ -1,6 +1,6 @@
{ lib, stdenv, writeScript, callPackage, buildFHSUserEnv, unwrapped ? callPackage ./runtime.nix {} }: { lib, stdenv, writeScript, callPackage, buildFHSEnv, unwrapped ? callPackage ./runtime.nix {} }:
buildFHSUserEnv rec { buildFHSEnv rec {
name = "houdini-${unwrapped.version}"; name = "houdini-${unwrapped.version}";
targetPkgs = pkgs: with pkgs; [ targetPkgs = pkgs: with pkgs; [

View file

@ -1,4 +1,4 @@
{ lib, buildFHSUserEnv, lutris-unwrapped { lib, buildFHSEnv, lutris-unwrapped
, extraPkgs ? pkgs: [ ] , extraPkgs ? pkgs: [ ]
, extraLibraries ? pkgs: [ ] , extraLibraries ? pkgs: [ ]
, steamSupport ? true , steamSupport ? true
@ -13,7 +13,7 @@ let
libXxf86vm libXinerama libSM libXv libXaw libXi libXcursor libXcomposite libXxf86vm libXinerama libSM libXv libXaw libXi libXcursor libXcomposite
]; ];
in buildFHSUserEnv { in buildFHSEnv {
name = "lutris"; name = "lutris";
runScript = "lutris"; runScript = "lutris";

View file

@ -5,7 +5,7 @@
, version , version
, desktopName , desktopName
, longDescription , longDescription
, buildFHSUserEnv , buildFHSEnv
, extraBuildInputs ? [ ] , extraBuildInputs ? [ ]
, jdk , jdk
, stdenv , stdenv
@ -68,7 +68,7 @@ let
in in
# Package with cups in FHS sandbox, because JAVA bin expects "/usr/bin/lpr" for printing. # Package with cups in FHS sandbox, because JAVA bin expects "/usr/bin/lpr" for printing.
buildFHSUserEnv { buildFHSEnv {
name = pname; name = pname;
targetPkgs = pkgs: [ targetPkgs = pkgs: [
cups cups

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, buildFHSUserEnv, makeDesktopItem, makeWrapper, atomEnv, libuuid, at-spi2-atk, icu, openssl, zlib }: { stdenv, lib, fetchurl, buildFHSEnv, makeDesktopItem, makeWrapper, atomEnv, libuuid, at-spi2-atk, icu, openssl, zlib }:
let let
pname = "sidequest"; pname = "sidequest";
version = "0.10.24"; version = "0.10.24";
@ -38,7 +38,7 @@
"$out/lib/SideQuest/sidequest" "$out/lib/SideQuest/sidequest"
''; '';
}; };
in buildFHSUserEnv { in buildFHSEnv {
name = "SideQuest"; name = "SideQuest";
passthru = { passthru = {

View file

@ -1,6 +1,6 @@
{ stdenv { stdenv
, lib , lib
, buildFHSUserEnvBubblewrap , buildFHSEnvBubblewrap
, copyDesktopItems , copyDesktopItems
, dpkg , dpkg
, lndir , lndir
@ -40,7 +40,7 @@ let
mimeTypes = [ "application/x-pkt" "application/x-pka" "application/x-pkz" ]; mimeTypes = [ "application/x-pkt" "application/x-pka" "application/x-pkz" ];
}; };
fhs = buildFHSUserEnvBubblewrap { fhs = buildFHSEnvBubblewrap {
name = "packettracer7"; name = "packettracer7";
runScript = "${ptFiles}/bin/packettracer7"; runScript = "${ptFiles}/bin/packettracer7";

View file

@ -2,7 +2,7 @@
, lib , lib
, alsa-lib , alsa-lib
, autoPatchelfHook , autoPatchelfHook
, buildFHSUserEnvBubblewrap , buildFHSEnvBubblewrap
, copyDesktopItems , copyDesktopItems
, dbus , dbus
, dpkg , dpkg
@ -97,7 +97,7 @@ let
mimeTypes = [ "application/x-pkt" "application/x-pka" "application/x-pkz" ]; mimeTypes = [ "application/x-pkt" "application/x-pka" "application/x-pkz" ];
}; };
fhs = buildFHSUserEnvBubblewrap { fhs = buildFHSEnvBubblewrap {
name = "packettracer8"; name = "packettracer8";
runScript = "${ptFiles}/bin/packettracer"; runScript = "${ptFiles}/bin/packettracer";
targetPkgs = pkgs: [ libudev0-shim ]; targetPkgs = pkgs: [ libudev0-shim ];

View file

@ -1,4 +1,4 @@
{ stdenv, lib, buildFHSUserEnv, writeScript, makeDesktopItem }: { stdenv, lib, buildFHSEnv, writeScript, makeDesktopItem }:
let platforms = [ "i686-linux" "x86_64-linux" ]; in let platforms = [ "i686-linux" "x86_64-linux" ]; in
@ -30,7 +30,7 @@ let
}; };
in in
buildFHSUserEnv { buildFHSEnv {
name = "dropbox"; name = "dropbox";
targetPkgs = pkgs: with pkgs; with xorg; [ targetPkgs = pkgs: with pkgs; with xorg; [

View file

@ -1,5 +1,5 @@
{ autoPatchelfHook { autoPatchelfHook
, buildFHSUserEnv , buildFHSEnv
, dpkg , dpkg
, fetchurl , fetchurl
, inotify-tools , inotify-tools
@ -41,7 +41,7 @@ let
''; '';
}; };
expressvpndFHS = buildFHSUserEnv { expressvpndFHS = buildFHSEnv {
name = "expressvpnd"; name = "expressvpnd";
# When connected, it directly creates/deletes resolv.conf to change the DNS entries. # When connected, it directly creates/deletes resolv.conf to change the DNS entries.

View file

@ -3,7 +3,7 @@
# of applications. # of applications.
# #
# What Nix does, simplifying a bit, is that it extracts an AppImage and starts # What Nix does, simplifying a bit, is that it extracts an AppImage and starts
# it via buildFHSUserEnv - this is totally fine for majority of apps, but makes # it via buildFHSEnv - this is totally fine for majority of apps, but makes
# it by-design *impossible* to launch SUID wrappers [^1]; in case of pCloud, # it by-design *impossible* to launch SUID wrappers [^1]; in case of pCloud,
# it's fusermount. # it's fusermount.
# (so pCloud starts, but silently fails to mount the FUSE drive.) # (so pCloud starts, but silently fails to mount the FUSE drive.)

View file

@ -1,6 +1,6 @@
{ stdenv { stdenv
, lib , lib
, buildFHSUserEnv , buildFHSEnv
, fetchurl , fetchurl
, gsettings-desktop-schemas , gsettings-desktop-schemas
, makeDesktopItem , makeDesktopItem
@ -57,7 +57,7 @@ let
''; '';
}; };
vmwareFHSUserEnv = name: buildFHSUserEnv { vmwareFHSUserEnv = name: buildFHSEnv {
inherit name; inherit name;
runScript = "${vmwareHorizonClientFiles}/bin/${name}_wrapper"; runScript = "${vmwareHorizonClientFiles}/bin/${name}_wrapper";

View file

@ -1,5 +1,5 @@
{ atk { atk
, buildFHSUserEnv , buildFHSEnv
, cairo , cairo
, dpkg , dpkg
, gdk-pixbuf , gdk-pixbuf
@ -56,7 +56,7 @@ let
${(wrapBinary libs) attrs.toolName} ${(wrapBinary libs) attrs.toolName}
''; '';
}); });
in buildFHSUserEnv { in buildFHSEnv {
name = "${attrs.toolName}-${attrs.version}"; name = "${attrs.toolName}-${attrs.version}";
runScript = "${pkg.outPath}/bin/${attrs.toolName}"; runScript = "${pkg.outPath}/bin/${attrs.toolName}";
} // { inherit (pkg) meta name; } } // { inherit (pkg) meta name; }

View file

@ -1,6 +1,6 @@
{ lib, stdenv { lib, stdenv
, autoPatchelfHook , autoPatchelfHook
, buildFHSUserEnv , buildFHSEnv
, dpkg , dpkg
, fetchurl , fetchurl
, gcc-unwrapped , gcc-unwrapped
@ -35,7 +35,7 @@ let
installPhase = "cp -ar usr $out"; installPhase = "cp -ar usr $out";
}; };
in in
buildFHSUserEnv { buildFHSEnv {
name = fahclient.name; name = fahclient.name;
targetPkgs = pkgs': [ targetPkgs = pkgs': [

View file

@ -8,7 +8,7 @@
, addOpenGLRunpath , addOpenGLRunpath
, libGLU , libGLU
, xorg , xorg
, buildFHSUserEnv , buildFHSEnv
, bash , bash
, writeText , writeText
, ocl-icd , ocl-icd
@ -133,7 +133,7 @@ let
} }
); );
in in
buildFHSUserEnv { buildFHSEnv {
name = "davinci-resolve"; name = "davinci-resolve";
targetPkgs = pkgs: with pkgs; [ targetPkgs = pkgs: with pkgs; [
librsvg librsvg

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, dpkg, makeWrapper, buildFHSUserEnv { lib, stdenv, fetchurl, dpkg, makeWrapper, buildFHSEnv
, gtk3, gdk-pixbuf, cairo, libjpeg_original, glib, pango, libGLU , gtk3, gdk-pixbuf, cairo, libjpeg_original, glib, pango, libGLU
, libGL, nvidia_cg_toolkit, zlib, openssl, libuuid , alsa-lib, udev, libjack2 , libGL, nvidia_cg_toolkit, zlib, openssl, libuuid , alsa-lib, udev, libjack2
}: }:
@ -73,7 +73,7 @@ let
}; };
# Lightworks expects some files in /usr/share/lightworks # Lightworks expects some files in /usr/share/lightworks
in buildFHSUserEnv { in buildFHSEnv {
name = lightworks.name; name = lightworks.name;
targetPkgs = pkgs: [ targetPkgs = pkgs: [

View file

@ -2,7 +2,7 @@
## - export ELECTRON_SKIP_BINARY_DOWNLOAD=1 ## - export ELECTRON_SKIP_BINARY_DOWNLOAD=1
## - jq "del(.scripts.preinstall)" node_modules/shellcheck/package.json | sponge node_modules/shellcheck/package.json ## - jq "del(.scripts.preinstall)" node_modules/shellcheck/package.json | sponge node_modules/shellcheck/package.json
{ {
lib, stdenv, buildFHSUserEnvBubblewrap, runCommand, writeScript, fetchurl, fetchzip lib, stdenv, buildFHSEnvBubblewrap, runCommand, writeScript, fetchurl, fetchzip
}: }:
let let
pname = "webtorrent-desktop"; pname = "webtorrent-desktop";
@ -20,7 +20,7 @@ runCommand "${pname}-${version}" rec {
else else
throw "Webtorrent is not currently supported on ${stdenv.hostPlatform.system}"; throw "Webtorrent is not currently supported on ${stdenv.hostPlatform.system}";
fhs = buildFHSUserEnvBubblewrap rec { fhs = buildFHSEnvBubblewrap rec {
name = "fhsEnterWebTorrent"; name = "fhsEnterWebTorrent";
runScript = "${src}/WebTorrent"; runScript = "${src}/WebTorrent";
## use the trampoline, if you need to shell into the fhsenv ## use the trampoline, if you need to shell into the fhsenv

View file

@ -1,5 +1,5 @@
{ stdenv { stdenv
, buildFHSUserEnv , buildFHSEnv
, fetchurl , fetchurl
, lib , lib
, zlib , zlib
@ -64,7 +64,7 @@ let
''; '';
}); });
vmware-unpack-env = buildFHSUserEnv rec { vmware-unpack-env = buildFHSEnv rec {
name = "vmware-unpack-env"; name = "vmware-unpack-env";
targetPkgs = pkgs: [ zlib ]; targetPkgs = pkgs: [ zlib ];
}; };

View file

@ -6,7 +6,7 @@
, libarchive , libarchive
, pv , pv
, squashfsTools , squashfsTools
, buildFHSUserEnv , buildFHSEnv
, pkgs , pkgs
}: }:
@ -43,7 +43,7 @@ rec {
extraPkgs, extraPkgs,
meta ? {}, meta ? {},
... ...
}: buildFHSUserEnv }: buildFHSEnv
(defaultFhsEnvArgs // { (defaultFhsEnvArgs // {
inherit name; inherit name;

View file

@ -6,7 +6,7 @@
}: }:
{ bash { bash
, buildFHSUserEnv , buildFHSEnv
, cacert , cacert
, git , git
, runCommand , runCommand
@ -100,7 +100,7 @@ let
# Wrap flutter inside an fhs user env to allow execution of binary, # Wrap flutter inside an fhs user env to allow execution of binary,
# like adb from $ANDROID_HOME or java from android-studio. # like adb from $ANDROID_HOME or java from android-studio.
fhsEnv = buildFHSUserEnv { fhsEnv = buildFHSEnv {
name = "${drvName}-fhs-env"; name = "${drvName}-fhs-env";
multiPkgs = pkgs: [ multiPkgs = pkgs: [
# Flutter only use these certificates # Flutter only use these certificates

View file

@ -1,4 +1,4 @@
{ lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSUserEnv, installShellFiles }: { lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSEnv, installShellFiles }:
let let
@ -48,10 +48,10 @@ let
in in
if stdenv.isLinux then if stdenv.isLinux then
# buildFHSUserEnv is needed because the arduino-cli downloads compiler # buildFHSEnv is needed because the arduino-cli downloads compiler
# toolchains from the internet that have their interpreters pointed at # toolchains from the internet that have their interpreters pointed at
# /lib64/ld-linux-x86-64.so.2 # /lib64/ld-linux-x86-64.so.2
buildFHSUserEnv buildFHSEnv
{ {
inherit (pkg) name meta; inherit (pkg) name meta;

View file

@ -1,8 +1,8 @@
{ lib, buildFHSUserEnv, arduino-core-unwrapped, withGui ? false, withTeensyduino ? false }: { lib, buildFHSEnv, arduino-core-unwrapped, withGui ? false, withTeensyduino ? false }:
let let
arduino-unwrapped = arduino-core-unwrapped.override { inherit withGui withTeensyduino; }; arduino-unwrapped = arduino-core-unwrapped.override { inherit withGui withTeensyduino; };
in in
buildFHSUserEnv { buildFHSEnv {
name = "arduino"; name = "arduino";
targetPkgs = targetPkgs =

View file

@ -1,4 +1,4 @@
{ lib, buildFHSUserEnv, platformio-core }: { lib, buildFHSEnv, platformio-core }:
let let
pio-pkgs = pkgs: pio-pkgs = pkgs:
@ -19,7 +19,7 @@ let
]); ]);
in in
buildFHSUserEnv { buildFHSEnv {
name = "platformio"; name = "platformio";
targetPkgs = pio-pkgs; targetPkgs = pio-pkgs;

View file

@ -8,7 +8,7 @@
, gnused , gnused
, gawk , gawk
, coreutils , coreutils
, buildFHSUserEnv , buildFHSEnv
}: }:
let let
@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
}; };
in in
if stdenv.isLinux then if stdenv.isLinux then
buildFHSUserEnv buildFHSEnv
{ {
name = "nextflow"; name = "nextflow";
targetPkgs = pkgs: [ nextflow ]; targetPkgs = pkgs: [ nextflow ];

View file

@ -94,7 +94,7 @@ buildPythonPackage rec {
# no tests in PyPI dist # no tests in PyPI dist
# run into https://stackoverflow.com/questions/51203641/attributeerror-module-alembic-context-has-no-attribute-config # run into https://stackoverflow.com/questions/51203641/attributeerror-module-alembic-context-has-no-attribute-config
# also, tests use conda so can't run on NixOS without buildFHSUserEnv # also, tests use conda so can't run on NixOS without buildFHSEnv
doCheck = false; doCheck = false;
meta = with lib; { meta = with lib; {

View file

@ -1,4 +1,4 @@
{ buildFHSUserEnv { buildFHSEnv
, electron_22 , electron_22
, fetchFromGitHub , fetchFromGitHub
, fetchYarnDeps , fetchYarnDeps
@ -86,7 +86,7 @@ let
}; };
in in
buildFHSUserEnv { buildFHSEnv {
name = "electron-fiddle"; name = "electron-fiddle";
runScript = "${electron}/bin/electron ${unwrapped}/lib/electron-fiddle/resources/app.asar"; runScript = "${electron}/bin/electron ${unwrapped}/lib/electron-fiddle/resources/app.asar";

View file

@ -1,6 +1,6 @@
{ lib { lib
, buildGoModule , buildGoModule
, buildFHSUserEnv , buildFHSEnv
, binutils , binutils
, dejavu_fonts , dejavu_fonts
, pkg-config , pkg-config
@ -84,7 +84,7 @@ let
}; };
in in
buildFHSUserEnv rec { buildFHSEnv rec {
name = pname; name = pname;
targetPkgs = pkgs: [ targetPkgs = pkgs: [
binutils binutils

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, dpkg, makeWrapper, buildFHSUserEnv { lib, stdenv, fetchurl, dpkg, makeWrapper, buildFHSEnv
, extraPkgs ? pkgs: [ ] , extraPkgs ? pkgs: [ ]
, extraLibs ? pkgs: [ ] , extraLibs ? pkgs: [ ]
}: }:
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
makeWrapper makeWrapper
]; ];
fhsEnv = buildFHSUserEnv { fhsEnv = buildFHSEnv {
name = "${pname}-fhs-env"; name = "${pname}-fhs-env";
runScript = ""; runScript = "";

View file

@ -1,4 +1,4 @@
{ fetchurl, stdenv, lib, buildFHSUserEnv, appimageTools, writeShellScript, anki, undmg, zstd, commandLineArgs ? [] }: { fetchurl, stdenv, lib, buildFHSEnv, appimageTools, writeShellScript, anki, undmg, zstd, commandLineArgs ? [] }:
let let
pname = "anki-bin"; pname = "anki-bin";
@ -50,7 +50,7 @@ let
passthru = { inherit sources; }; passthru = { inherit sources; };
fhsUserEnvAnki = buildFHSUserEnv (appimageTools.defaultFhsEnvArgs // { fhsEnvAnki = buildFHSEnv (appimageTools.defaultFhsEnvArgs // {
inherit pname version; inherit pname version;
name = null; # Appimage sets it to "appimage-env" name = null; # Appimage sets it to "appimage-env"
@ -75,7 +75,7 @@ let
}); });
in in
if stdenv.isLinux then fhsUserEnvAnki if stdenv.isLinux then fhsEnvAnki
else stdenv.mkDerivation { else stdenv.mkDerivation {
inherit pname version passthru; inherit pname version passthru;

View file

@ -1,6 +1,6 @@
{ clonehero-unwrapped { clonehero-unwrapped
, makeDesktopItem , makeDesktopItem
, buildFHSUserEnv , buildFHSEnv
, liberation_ttf , liberation_ttf
, callPackage , callPackage
}: }:
@ -16,7 +16,7 @@ let
categories = [ "Game" ]; categories = [ "Game" ];
}; };
in in
buildFHSUserEnv { buildFHSEnv {
inherit name; inherit name;
inherit (clonehero-unwrapped) meta; inherit (clonehero-unwrapped) meta;

View file

@ -1,11 +1,11 @@
{ lib { lib
, buildFHSUserEnv , buildFHSEnv
, heroic-unwrapped , heroic-unwrapped
, extraPkgs ? pkgs: [ ] , extraPkgs ? pkgs: [ ]
, extraLibraries ? pkgs: [ ] , extraLibraries ? pkgs: [ ]
}: }:
buildFHSUserEnv { buildFHSEnv {
name = "heroic"; name = "heroic";
runScript = "heroic"; runScript = "heroic";

View file

@ -1,4 +1,4 @@
{ stdenvNoCC, lib, fetchurl, buildFHSUserEnv }: { stdenvNoCC, lib, fetchurl, buildFHSEnv }:
let let
version = "2.3"; version = "2.3";
@ -20,7 +20,7 @@ let
}; };
# FHS env, as patchelf will not work # FHS env, as patchelf will not work
env = buildFHSUserEnv { env = buildFHSEnv {
name = "left4gore-env-${version}"; name = "left4gore-env-${version}";
targetPkgs = _: [ left4gore-unwrapped ]; targetPkgs = _: [ left4gore-unwrapped ];
runScript = "left4gore"; runScript = "left4gore";

View file

@ -1,7 +1,7 @@
{ stdenv { stdenv
, lib , lib
, autoPatchelfHook , autoPatchelfHook
, buildFHSUserEnv , buildFHSEnv
, cairo , cairo
, dpkg , dpkg
, fetchurl , fetchurl
@ -109,10 +109,10 @@ in
/* /*
* We can patch the runescape launcher, but it downloads a client at runtime and checks it for changes. * We can patch the runescape launcher, but it downloads a client at runtime and checks it for changes.
* For that we need use a buildFHSUserEnv. * For that we need use a buildFHSEnv.
* FHS simulates a classic linux shell * FHS simulates a classic linux shell
*/ */
buildFHSUserEnv { buildFHSEnv {
name = "RuneScape"; name = "RuneScape";
targetPkgs = pkgs: [ targetPkgs = pkgs: [
runescape runescape

View file

@ -1,9 +1,9 @@
{ buildFHSUserEnv, callPackage, lib }: { buildFHSEnv, callPackage, lib }:
let let
shticker-book-unwritten-unwrapped = callPackage ./unwrapped.nix { }; shticker-book-unwritten-unwrapped = callPackage ./unwrapped.nix { };
in buildFHSUserEnv { in buildFHSEnv {
name = "shticker_book_unwritten"; name = "shticker_book_unwritten";
targetPkgs = pkgs: with pkgs; [ targetPkgs = pkgs: with pkgs; [
alsa-lib alsa-lib

View file

@ -1,5 +1,5 @@
{ makeScopeWithSplicing, generateSplicesForMkScope { makeScopeWithSplicing, generateSplicesForMkScope
, stdenv, buildFHSUserEnv, pkgsi686Linux , stdenv, buildFHSEnv, pkgsi686Linux
}: }:
let let
@ -19,7 +19,7 @@ let
if self.steamArch == "amd64" if self.steamArch == "amd64"
then pkgsi686Linux.steamPackages.steam-runtime-wrapped then pkgsi686Linux.steamPackages.steam-runtime-wrapped
else null; else null;
inherit buildFHSUserEnv; inherit buildFHSEnv;
}; };
steam-fhsenv-small = steam-fhsenv.override { withGameSpecificLibraries = false; }; steam-fhsenv-small = steam-fhsenv.override { withGameSpecificLibraries = false; };
steamcmd = callPackage ./steamcmd.nix { }; steamcmd = callPackage ./steamcmd.nix { };

View file

@ -1,4 +1,4 @@
{ lib, stdenv, writeShellScript, buildFHSUserEnv, steam, glxinfo-i686 { lib, stdenv, writeShellScript, buildFHSEnv, steam, glxinfo-i686
, steam-runtime-wrapped, steam-runtime-wrapped-i686 ? null , steam-runtime-wrapped, steam-runtime-wrapped-i686 ? null
, extraPkgs ? pkgs: [ ] # extra packages to add to targetPkgs , extraPkgs ? pkgs: [ ] # extra packages to add to targetPkgs
, extraLibraries ? pkgs: [ ] # extra packages to add to multiPkgs , extraLibraries ? pkgs: [ ] # extra packages to add to multiPkgs
@ -55,7 +55,7 @@ let
envScript = lib.toShellVars extraEnv; envScript = lib.toShellVars extraEnv;
in buildFHSUserEnv rec { in buildFHSEnv rec {
name = "steam"; name = "steam";
targetPkgs = pkgs: with pkgs; [ targetPkgs = pkgs: with pkgs; [
@ -270,7 +270,7 @@ in buildFHSUserEnv rec {
# breaks the ability for application to reference shared memory. # breaks the ability for application to reference shared memory.
unsharePid = false; unsharePid = false;
passthru.run = buildFHSUserEnv { passthru.run = buildFHSEnv {
name = "steam-run"; name = "steam-run";
targetPkgs = commonTargetPkgs; targetPkgs = commonTargetPkgs;

View file

@ -4,7 +4,7 @@
, fetchFromGitHub , fetchFromGitHub
, fetchpatch , fetchpatch
, SDL2 , SDL2
, buildFHSUserEnv , buildFHSEnv
, cmake , cmake
, copyDesktopItems , copyDesktopItems
, curl , curl
@ -95,7 +95,7 @@ let
''; '';
}; };
fhsEnv = buildFHSUserEnv { fhsEnv = buildFHSEnv {
name = "unvanquished-fhs-wrapper"; name = "unvanquished-fhs-wrapper";
targetPkgs = pkgs: [ libstdcpp-preload-for-unvanquished-nacl ]; targetPkgs = pkgs: [ libstdcpp-preload-for-unvanquished-nacl ];

View file

@ -1,6 +1,6 @@
{ lib { lib
, stdenv , stdenv
, buildFHSUserEnvBubblewrap , buildFHSEnvBubblewrap
, corefonts , corefonts
, dejavu_fonts , dejavu_fonts
, dpkg , dpkg
@ -57,7 +57,7 @@ let
dontStrip = true; dontStrip = true;
passthru = { passthru = {
fhs = buildFHSUserEnvBubblewrap { fhs = buildFHSEnvBubblewrap {
name = "onlyoffice-wrapper"; name = "onlyoffice-wrapper";
targetPkgs = pkgs: [ targetPkgs = pkgs: [

View file

@ -1,6 +1,6 @@
# The actual Plex package that we run is a FHS userenv of the "raw" package. # The actual Plex package that we run is a FHS userenv of the "raw" package.
{ stdenv { stdenv
, buildFHSUserEnvBubblewrap , buildFHSEnvBubblewrap
, writeScript , writeScript
, plexRaw , plexRaw
@ -9,7 +9,7 @@
, dataDir ? "/var/lib/plex" , dataDir ? "/var/lib/plex"
}: }:
buildFHSUserEnvBubblewrap { buildFHSEnvBubblewrap {
name = "plexmediaserver"; name = "plexmediaserver";
inherit (plexRaw) meta; inherit (plexRaw) meta;

View file

@ -1,4 +1,4 @@
{ lib, fetchurl, jdk, buildFHSUserEnv, unzip, makeDesktopItem }: { lib, fetchurl, jdk, buildFHSEnv, unzip, makeDesktopItem }:
let let
version = "2023.2.4"; version = "2023.2.4";
@ -23,7 +23,7 @@ let
}; };
in in
buildFHSUserEnv { buildFHSEnv {
inherit name; inherit name;
runScript = "${jdk}/bin/java -jar ${src}"; runScript = "${jdk}/bin/java -jar ${src}";

View file

@ -1,4 +1,4 @@
{ appimageTools, buildFHSUserEnv, makeDesktopItem, extraPkgs ? pkgs: [], appimage-run-tests ? null }: { appimageTools, buildFHSEnv, makeDesktopItem, extraPkgs ? pkgs: [], appimage-run-tests ? null }:
let let
name = "appimage-run"; name = "appimage-run";
@ -14,7 +14,7 @@ let
mimeTypes = ["application/vnd.appimage" "application/x-iso9660-appimage"]; mimeTypes = ["application/vnd.appimage" "application/x-iso9660-appimage"];
categories = ["PackageManager" "Utility"]; categories = ["PackageManager" "Utility"];
}; };
in buildFHSUserEnv (fhsArgs // { in buildFHSEnv (fhsArgs // {
inherit name; inherit name;
targetPkgs = pkgs: [ appimageTools.appimage-exec ] targetPkgs = pkgs: [ appimageTools.appimage-exec ]

View file

@ -3,7 +3,7 @@
, fetchurl , fetchurl
, runCommand , runCommand
, makeWrapper , makeWrapper
, buildFHSUserEnv , buildFHSEnv
, libselinux , libselinux
, libarchive , libarchive
, libGL , libGL
@ -63,7 +63,7 @@ let
--prefix "LD_LIBRARY_PATH" : "${libPath}" --prefix "LD_LIBRARY_PATH" : "${libPath}"
''); '');
in in
buildFHSUserEnv { buildFHSEnv {
name = "conda-shell"; name = "conda-shell";
targetPkgs = pkgs: (builtins.concatLists [ [ conda ] condaDeps extraPkgs]); targetPkgs = pkgs: (builtins.concatLists [ [ conda ] condaDeps extraPkgs]);
profile = '' profile = ''

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, dpkg, buildFHSUserEnv { lib, stdenv, fetchurl, dpkg, buildFHSEnv
, glibc, glib, openssl, tpm2-tss , glibc, glib, openssl, tpm2-tss
, gtk3, gnome, polkit, polkit_gnome , gtk3, gnome, polkit, polkit_gnome
}: }:
@ -70,7 +70,7 @@ let
''; '';
}; };
# /usr/bin/pkcheck is hardcoded in binary - we need FHS # /usr/bin/pkcheck is hardcoded in binary - we need FHS
in buildFHSUserEnv { in buildFHSEnv {
inherit meta; inherit meta;
name = pname; name = pname;

View file

@ -163,6 +163,10 @@ mapAliases ({
bud = throw "bud has been removed: abandoned by upstream"; # Added 2022-03-14 bud = throw "bud has been removed: abandoned by upstream"; # Added 2022-03-14
inherit (libsForQt5.mauiPackages) buho; # added 2022-05-17 inherit (libsForQt5.mauiPackages) buho; # added 2022-05-17
buttersink = throw "buttersink has been removed: abandoned by upstream"; # Added 2022-04-05 buttersink = throw "buttersink has been removed: abandoned by upstream"; # Added 2022-04-05
# Shorter names; keep the longer name for back-compat. Added 2023-04-11
buildFHSUserEnv = buildFHSEnv;
buildFHSUserEnvChroot = buildFHSEnvChroot;
buildFHSUserEnvBubblewrap = buildFHSEnvBubblewrap;
# bitwarden_rs renamed to vaultwarden with release 1.21.0 (2021-04-30) # bitwarden_rs renamed to vaultwarden with release 1.21.0 (2021-04-30)
bitwarden_rs = vaultwarden; bitwarden_rs = vaultwarden;

View file

@ -371,9 +371,9 @@ with pkgs;
buildEnv = callPackage ../build-support/buildenv { }; # not actually a package buildEnv = callPackage ../build-support/buildenv { }; # not actually a package
buildFHSUserEnv = buildFHSUserEnvBubblewrap; buildFHSEnv = buildFHSEnvBubblewrap;
buildFHSUserEnvChroot = callPackage ../build-support/build-fhs-userenv { }; buildFHSEnvChroot = callPackage ../build-support/build-fhsenv-chroot { };
buildFHSUserEnvBubblewrap = callPackage ../build-support/build-fhs-userenv-bubblewrap { }; buildFHSEnvBubblewrap = callPackage ../build-support/build-fhsenv-bubblewrap { };
buildMaven = callPackage ../build-support/build-maven.nix { }; buildMaven = callPackage ../build-support/build-maven.nix { };
@ -16445,7 +16445,7 @@ with pkgs;
zulip = callPackage ../applications/networking/instant-messengers/zulip { zulip = callPackage ../applications/networking/instant-messengers/zulip {
# Bubblewrap breaks zulip, see https://github.com/NixOS/nixpkgs/pull/97264#issuecomment-704454645 # Bubblewrap breaks zulip, see https://github.com/NixOS/nixpkgs/pull/97264#issuecomment-704454645
appimageTools = pkgs.appimageTools.override { appimageTools = pkgs.appimageTools.override {
buildFHSUserEnv = pkgs.buildFHSUserEnv; buildFHSEnv = pkgs.buildFHSEnvChroot;
}; };
}; };