- Jul 04, 2014
-
-
Eelco Dolstra authored
Fixes #294.
-
- Jul 03, 2014
-
-
Eelco Dolstra authored
-
- Jun 27, 2014
-
-
Eelco Dolstra authored
-
Paul Colomiets authored
-
Eelco Dolstra authored
-
Eelco Dolstra authored
-
- Jun 24, 2014
-
-
Shea Levy authored
Only add the importNative primop if the allow-arbitrary-code-during-evaluation option is true (default false)
-
- Jun 17, 2014
-
-
Shea Levy authored
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.
-
- Jun 12, 2014
-
-
Eelco Dolstra authored
They're a little bit too recent (only supported since GCC 4.7). http://hydra.nixos.org/build/11851475
-
Eelco Dolstra authored
Also, yay for C++11 non-static initialisers.
-
Eelco Dolstra authored
We're not catching these anywhere.
-
Shea Levy authored
-
Shea Levy authored
In addition to reducing duplication, this fixes both import from derivation and import of derivation for scopedImport
-
Steve Purcell authored
- Use define-derived-mode to declare nix-mode - Use autoloads to ensure nix-mode is usable (and enabled) without needing `require` - Use set + make-local-variable instead of longer 2-step equivalent
-
- Jun 10, 2014
-
-
Eelco Dolstra authored
There really is no case I can think of where taking the context into account is useful. Mostly it's just very inconvenient.
-
Eelco Dolstra authored
When copying a large path causes the daemon to run out of memory, you now get: error: Nix daemon out of memory instead of: error: writing to file: Broken pipe
-
Eelco Dolstra authored
I.e. if you have a derivation with src = ./huge-directory; you'll get a warning that this is not a good idea.
-
- Jun 02, 2014
-
-
Eelco Dolstra authored
-
- May 29, 2014
-
-
Eelco Dolstra authored
-
Eelco Dolstra authored
-
- May 26, 2014
-
-
Eelco Dolstra authored
-
Aristid Breitkreuz authored
-
Sönke Hahn authored
'type -p' does not work in e.g. dash
-
Adam Szkoda authored
-
Eelco Dolstra authored
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.
-
Eelco Dolstra authored
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 c273c15c), 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
-
Eelco Dolstra authored
Also fixes #261.
-
Eelco Dolstra authored
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"; } ]
-
Eelco Dolstra authored
‘scopedImport’ works like ‘import’, except that it takes a set of attributes to be added to the lexical scope of the expression, essentially extending or overriding the builtin variables. For instance, the expression scopedImport { x = 1; } ./foo.nix where foo.nix contains ‘x’, will evaluate to 1. This has a few applications: * It allows getting rid of function argument specifications in package expressions. For instance, a package expression like: { stdenv, fetchurl, libfoo }: stdenv.mkDerivation { ... buildInputs = [ libfoo ]; } can now we written as just stdenv.mkDerivation { ... buildInputs = [ libfoo ]; } and imported in all-packages.nix as: bar = scopedImport pkgs ./bar.nix; So whereas we once had dependencies listed in three places (buildInputs, the function, and the call site), they now only need to appear in one place. * It allows overriding builtin functions. For instance, to trace all calls to ‘map’: let overrides = { map = f: xs: builtins.trace "map called!" (map f xs); # Ensure that our override gets propagated by calls to # import/scopedImport. import = fn: scopedImport overrides fn; scopedImport = attrs: fn: scopedImport (overrides // attrs) fn; # Also update ‘builtins’. builtins = builtins // overrides; }; in scopedImport overrides ./bla.nix * Similarly, it allows extending the set of builtin functions. For instance, during Nixpkgs/NixOS evaluation, the Nixpkgs library functions could be added to the default scope. There is a downside: calls to scopedImport are not memoized, unlike import. So importing a file multiple times leads to multiple parsings / evaluations. It would be possible to construct the AST only once, but that would require careful handling of variables/environments.
-
Eelco Dolstra authored
-
- May 23, 2014
-
-
Eelco Dolstra authored
Fixes #265.
-
- May 22, 2014
-
-
Eelco Dolstra authored
It breaks randomly: http://hydra.nixos.org/build/11152871
-
- May 21, 2014
-
-
Eelco Dolstra authored
If a build log is not available locally, then ‘nix-store -l’ will now try to download it from the servers listed in the ‘log-servers’ option in nix.conf. For instance, if you have: log-servers = http://hydra.nixos.org/log then it will try to get logs from http://hydra.nixos.org/log/<base name of the store path>. So you can do things like: $ nix-store -l $(which xterm) and get a log even if xterm wasn't built locally.
-
- May 15, 2014
-
-
Shea Levy authored
-
Eelco Dolstra authored
-
Eelco Dolstra authored
-
Eelco Dolstra authored
-
Eelco Dolstra authored
-
Wout Mertens authored
readdir() already returns the inode numbers, so we don't need to call lstat to know if a file was already linked or not.
-
- May 14, 2014
-
-
Wout Mertens authored
-