mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Don't define builtins.{currentSystem,currentTime} in pure mode
This makes it easier to provide a default, e.g. system = builtins.currentSystem or "x86_64-linux";
This commit is contained in:
parent
5647e55f65
commit
0c95776c3e
2 changed files with 3 additions and 7 deletions
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
pkgs = import nixpkgs { system = builtins.currentSystem or "x86_64-linux"; };
|
||||||
|
|
||||||
jobs = rec {
|
jobs = rec {
|
||||||
|
|
||||||
|
|
|
@ -1997,16 +1997,12 @@ void EvalState::createBaseEnv()
|
||||||
addConstant(name, v);
|
addConstant(name, v);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (settings.pureEval)
|
if (!settings.pureEval) {
|
||||||
addPurityError("__currentTime");
|
|
||||||
else {
|
|
||||||
mkInt(v, time(0));
|
mkInt(v, time(0));
|
||||||
addConstant("__currentTime", v);
|
addConstant("__currentTime", v);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.pureEval)
|
if (!settings.pureEval) {
|
||||||
addPurityError("__currentSystem");
|
|
||||||
else {
|
|
||||||
mkString(v, settings.thisSystem);
|
mkString(v, settings.thisSystem);
|
||||||
addConstant("__currentSystem", v);
|
addConstant("__currentSystem", v);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue