- # Run the given derivation in outside of a chroot. This hack is used on
- # hydra.gnu.org where we want Guix derivations to run in a chroot that lacks
- # /bin, whereas Nixpkgs relies on /bin/sh.
- unchroot =
- let
- pkgs = import nixpkgs {};
-
- # XXX: The `python' derivation contains a `modules' attribute that makes
- # `overrideDerivation' fail with "cannot coerce an attribute set (except
- # a derivation) to a string", so just remove it.
- pythonKludge = drv: removeAttrs drv [ "modules" ];
- in
- drv:
- if builtins.isAttrs drv
- then pkgs.lib.overrideDerivation (pythonKludge drv) (args: {
- __noChroot = true;
- buildNativeInputs = map unchroot args.buildNativeInputs;
- propagatedBuildNativeInputs =
- map unchroot args.propagatedBuildNativeInputs;
- })
- else drv;
-