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
|
@ -6,7 +6,7 @@
|
|||
|
||||
let
|
||||
|
||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||
pkgs = import nixpkgs { system = builtins.currentSystem or "x86_64-linux"; };
|
||||
|
||||
jobs = rec {
|
||||
|
||||
|
|
|
@ -1997,16 +1997,12 @@ void EvalState::createBaseEnv()
|
|||
addConstant(name, v);
|
||||
};
|
||||
|
||||
if (settings.pureEval)
|
||||
addPurityError("__currentTime");
|
||||
else {
|
||||
if (!settings.pureEval) {
|
||||
mkInt(v, time(0));
|
||||
addConstant("__currentTime", v);
|
||||
}
|
||||
|
||||
if (settings.pureEval)
|
||||
addPurityError("__currentSystem");
|
||||
else {
|
||||
if (!settings.pureEval) {
|
||||
mkString(v, settings.thisSystem);
|
||||
addConstant("__currentSystem", v);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue