Skip to content

Commit

Permalink
runInFHSUserEnv: init
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvishJerricco committed Jun 28, 2022
1 parent 0c4852c commit 05742c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkgs/build-support/run-in-fhs/default.nix
@@ -0,0 +1,15 @@
{ lib, buildFHSUserEnv }:

# Similar to runInLinuxVM, except we run under a FHS user env instead
# of a VM. This allows you to use build systems that depend on the FHS
# without any sort of patching. Resulting binaries may not work on
# NixOS without wrapping them in FHS though.
drv: envArgs: let
fhsWrapper = buildFHSUserEnv ({
name = "${drv.name}-fhs-wrapper";
runScript = "$@";
} // envArgs);
in lib.overrideDerivation drv (old: {
builder = "${fhsWrapper}/bin/${fhsWrapper.name}";
args = [old.builder] ++ old.args;
})
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -306,6 +306,7 @@ with pkgs;
buildFHSUserEnv = buildFHSUserEnvChroot;
buildFHSUserEnvChroot = callPackage ../build-support/build-fhs-userenv { };
buildFHSUserEnvBubblewrap = callPackage ../build-support/build-fhs-userenv-bubblewrap { };
runInFHSUserEnv = callPackage ../build-support/run-in-fhs { };

buildMaven = callPackage ../build-support/build-maven.nix {};

Expand Down

0 comments on commit 05742c1

Please sign in to comment.