aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-05-26Remove ExprBuiltinEelco Dolstra
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.
2014-05-26Make the Nix search path declarativeEelco Dolstra
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
2014-05-26Ensure that -I flags get included in nixPathEelco Dolstra
Also fixes #261.
2014-05-26Add constant ‘nixPath’Eelco Dolstra
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"; } ]
2014-05-26Add primop ‘scopedImport’Eelco Dolstra
‘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.
2014-05-26Shut up some signedness warningsEelco Dolstra
2014-05-23Ugly hack to allow --argstr values starting with a dashEelco Dolstra
Fixes #265.
2014-05-22Disable parallel.sh testEelco Dolstra
It breaks randomly: http://hydra.nixos.org/build/11152871
2014-05-21nix-store -l: Fetch build logs from the InternetEelco Dolstra
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.
2014-05-15Provide a more useful error message when a dynamic attr lookup failsShea Levy
2014-05-15lvlInfo -> lvlTalkativeEelco Dolstra
2014-05-15nix-store --optimise: Remove bogus statisticsEelco Dolstra
2014-05-15Remove tabEelco Dolstra
2014-05-15Merge branch 'master' of github.com:wmertens/nixEelco Dolstra
2014-05-15Shortcut store files before lstatWout Mertens
readdir() already returns the inode numbers, so we don't need to call lstat to know if a file was already linked or not.
2014-05-14Use the inodes given by readdir directlyWout Mertens
2014-05-14Remove redundant codeEelco Dolstra
2014-05-13Preload linked hashes to speed up lookupsWout Mertens
By preloading all inodes in the /nix/store/.links directory, we can quickly determine of a hardlinked file was already linked to the hashed links. This is tolerant of removing the .links directory, it will simply recalculate all hashes in the store.
2014-05-13Prepare nix-mode to be uploaded to marmaladeRicky Elrod
Signed-off-by: Ricky Elrod <ricky@elrod.me>
2014-05-13nix-instantiate --eval: Apply auto-arguments if the result is a functionEelco Dolstra
Fixes #254.
2014-05-13fix typoCharles Strahan
2014-05-10Shortcut already-hardlinked fileswmertens
If an inode in the Nix store has more than 1 link, it probably means that it was linked into .links/ by us. If so, skip. There's a possibility that something else hardlinked the file, so it would be nice to be able to override this. Also, by looking at the number of hardlinks for each of the files in .links/, you can get deduplication numbers and space savings.
2014-05-06Really fix the RPM buildsEelco Dolstra
http://hydra.nixos.org/build/10840199
2014-05-05Fix RPM buildEelco Dolstra
We don't install a nix.conf anymore. http://hydra.nixos.org/build/10826143
2014-05-03Add ubuntu 14.04Rob Vermaas
2014-05-02Don't install Upstart job on FedoraEelco Dolstra
Also, don't install a nix.conf anymore, it's not needed. http://hydra.nixos.org/build/10775854
2014-05-02Fix Debian testsEelco Dolstra
These actually run as root in a VM, so they get confused. http://hydra.nixos.org/build/10775854
2014-05-02Simplify multi-user installation instructionsEelco Dolstra
2014-05-02Set up directories and permissions for multi-user install automaticallyEelco Dolstra
This automatically creates /nix/var/nix/profiles/per-user and sets the permissions/ownership on /nix/store to 1775 and root:nixbld.
2014-05-02Install an Upstart serviceEelco Dolstra
2014-05-02Set build-max-jobs to the number of available cores by defaultEelco Dolstra
More zero configuration.
2014-05-02When running as root, use build users by defaultEelco Dolstra
This removes the need to have a nix.conf, and prevents people from accidentally running Nix builds as root.
2014-04-28doc fix: swap 'import' and 'export'Charles Strahan
2014-04-25trunk -> masterEelco Dolstra
2014-04-15nix-env: Minor change to '--delete-generations Nd' semanticsRicardo M. Correia
The option '--delete-generations Nd' deletes all generations older than N days. However, most likely the user does not want to delete the generation that was active N days ago. For example, say that you have these 3 generations: 1: <30 days ago> 2: <15 days ago> 3: <1 hour ago> If you do --delete-generations 7d (say, as part of a cron job), most likely you still want to keep generation 2, i.e. the generation that was active 7 days ago (and for most of the past 7 days, in fact). This patch fixes this issue. Note that this also affects 'nix-collect-garbage --delete-older-than Nd'. Thanks to @roconnor for noticing the issue!
2014-04-15Fix test evaluationEelco Dolstra
2014-04-11Bump dateEelco Dolstra
2014-04-11Bump version to 1.8Eelco Dolstra
2014-04-10Don't barf when installing as rootEelco Dolstra
2014-04-09Add docbook icons to the distributionEelco Dolstra
Grmbl...
2014-04-08If a .drv cannot be parsed, show its pathEelco Dolstra
Otherwise you just get ‘expected string `Derive(['’ which isn't very helpful.
2014-04-08Simplify quick start sectionEelco Dolstra
2014-04-08Remove redundant stuffEelco Dolstra
2014-04-08Update installation instructionsEelco Dolstra
2014-04-08nix-shell --pure: Keep the user's $PAGEREelco Dolstra
2014-04-08Ensure that systemd units to into lib, not lib64Eelco Dolstra
http://hydra.nixos.org/build/10170940
2014-04-07Update release notesEelco Dolstra
2014-04-07Install systemd unitsEelco Dolstra
2014-04-04Show position info in attribute selection errorsEelco Dolstra
2014-04-04Show position info in Boolean operationsEelco Dolstra