Age | Commit message (Collapse) | Author |
|
This gives a ~18% speedup in NixOS evaluation (after converting
most calls to hasAttr/getAttr to dynamic attrs).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
So you can now do things like:
$ nix-env -qa '.*zip.*'
$ nix-env -qa '.*(firefox|chromium).*'
|
|
|
|
|
|
|
|
|
|
Workaround for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41174. This caused
hydra-eval-jobs to ignore SIGINT.
|
|
Note that unlike ‘lib.deepSeq’ in Nixpkgs, this handles cycles.
|
|
|
|
|
|
So this no longer crashes with a stack overflow:
nix-instantiate -E --eval 'let as = { x = as; }; in as'
Instead it prints:
{ x = { x = <CYCLE>; }; }
|
|
|
|
It returns the size of value, including all other values and
environments reachable from it. It is intended for debugging memory
consumption issues.
|
|
|
|
|
|
|
|
This prevents a double allocation per attribute set.
|
|
http://hydra.nixos.org/build/14344391
|
|
|
|
|
|
|
|
Fixes #333.
|
|
This was triggered by 47e185847e729d49e6aa376e8299fd66ef834a0a, which
turned globals.state into a pointer.
|
|
|
|
|
|
|
|
|
|
The name ‘nixPath’ breaks existing code.
|
|
|
|
src/libexpr/primops.cc:42:8: error: looser throw specifier for 'virtual nix::InvalidPathError::~InvalidPathError()'
src/libexpr/nixexpr.hh:12:1: error: overriding 'virtual nix::EvalError::~EvalError() noexcept (true)'
http://hydra.nixos.org/build/12385750
|
|
Fixes #294.
|
|
allow-arbitrary-code-during-evaluation option is true (default false)
|
|
This can be used to import a dynamic shared object and return an
arbitrary value, including new primops. This can be used both to test
new primops without having to recompile nix every time, and to build
specialized primops that probably don't belong upstream (e.g. a function
that calls out to gpg to decrypt a nixops secret as-needed).
The imported function should initialize the Value & as needed. A single
import can define multiple values by creating an attrset or list, of
course.
An example initialization function might look like:
extern "C" void initialize(nix::EvalState & state, nix::Value & v)
{
v.type = nix::tPrimOp;
v.primOp = NEW nix::PrimOp(myFun, 1, state.symbols.create("myFun"));
}
Then `builtins.importNative ./example.so "initialize"` will evaluate to
the primop defined in the myFun function.
|
|
We're not catching these anywhere.
|
|
|
|
In addition to reducing duplication, this fixes both import from
derivation and import of derivation for scopedImport
|
|
There really is no case I can think of where taking the context into
account is useful. Mostly it's just very inconvenient.
|
|
|
|
|
|
It's slower than ExprVar since it doesn't compute a static
displacement. Since we're not using the throw primop in the
implementation of <...> anymore, it's also not really needed.
|
|
Nix search path lookups like <nixpkgs> are now desugared to ‘findFile
nixPath <nixpkgs>’, where ‘findFile’ is a new primop. Thus you can
override the search path simply by saying
let
nixPath = [ { prefix = "nixpkgs"; path = "/my-nixpkgs"; } ];
in ... <nixpkgs> ...
In conjunction with ‘scopedImport’ (commit
c273c15cb13bb86420dda1e5341a4e19517532b5), the Nix search path can be
propagated across imports, e.g.
let
overrides = {
nixPath = [ ... ] ++ builtins.nixPath;
import = fn: scopedImport overrides fn;
scopedImport = attrs: fn: scopedImport (overrides // attrs) fn;
builtins = builtins // overrides;
};
in scopedImport overrides ./nixos
|
|
Also fixes #261.
|
|
It contains the Nix expression search path as a list of { prefix, path
} sets, e.g.
[ { path = "/nix/var/nix/profiles/per-user/root/channels/nixos"; prefix = ""; }
{ path = "/etc/nixos/configuration.nix"; prefix = "nixos-config"; }
{ path = "/home/eelco/Dev/nix/inst/share/nix/corepkgs"; prefix = "nix"; }
]
|