mkUserEnvironment: fix Nix compatibility issue
it was relying on a file that is not available in Nix unstable anymore
This commit is contained in:
parent
d454de5f07
commit
dacde3f71f
1 changed files with 32 additions and 2 deletions
|
@ -21,6 +21,36 @@
|
|||
# Supporting code
|
||||
with builtins;
|
||||
let
|
||||
# Copied from https://github.com/nixos/nix/blob/e02481ded216ffb5b06b413e3695d4e11e62e02f/corepkgs/buildenv.nix
|
||||
#
|
||||
# This was available at <nix/buildenv.nix>, until it got removed in Nix.
|
||||
buildenv = { derivations, manifest }:
|
||||
derivation {
|
||||
name = "user-environment";
|
||||
system = "builtin";
|
||||
builder = "builtin:buildenv";
|
||||
|
||||
inherit manifest;
|
||||
|
||||
# !!! grmbl, need structured data for passing this in a clean way.
|
||||
derivations =
|
||||
map
|
||||
(d:
|
||||
[
|
||||
(d.meta.active or "true")
|
||||
(d.meta.priority or 5)
|
||||
(builtins.length d.outputs)
|
||||
] ++ map (output: builtins.getAttr output d) d.outputs)
|
||||
derivations;
|
||||
|
||||
# Building user environments remotely just causes huge amounts of
|
||||
# network traffic, so don't do that.
|
||||
preferLocalBuild = true;
|
||||
|
||||
# Also don't bother substituting.
|
||||
allowSubstitutes = false;
|
||||
};
|
||||
|
||||
# back-compat
|
||||
isPath = builtins.isPath or (x: builtins.typeOf x == "path");
|
||||
|
||||
|
@ -75,7 +105,7 @@ let
|
|||
toNix (map genManifest derivations)
|
||||
);
|
||||
in
|
||||
import <nix/buildenv.nix> {
|
||||
buildenv {
|
||||
inherit derivations;
|
||||
manifest = writeManifest derivations;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue