Commit graph

16205 commits

Author SHA1 Message Date
Eelco Dolstra
3d77b28eac Add comparison operators ‘<’, ‘<=’, ‘>’ and ‘>=’ 2013-08-02 18:39:40 +02:00
Eelco Dolstra
47701677e8 Add integer ‘-’, ‘*’ and ‘/’ operators 2013-08-02 16:03:02 +00:00
Eelco Dolstra
5d147e125c Add a unary integer negation operator
This allows saying "-1" instead of "builtins.sub 0 1".
2013-08-02 15:43:31 +00:00
Eelco Dolstra
159e621d1a Overload the ‘+’ operator to support integer addition 2013-08-02 15:21:17 +00:00
Vincent Ambo
580f642d40 emacs: Function to toggle native/non-native fullscreen on OS X 2013-08-01 11:31:13 +02:00
Eelco Dolstra
511455965e nix-shell: Don't disable Automake dependency tracking
Nixpkgs' stdenv disables dependency tracking by default.  That makes
sense for one-time builds, but in an interactive environment we expect
repeated "make" invocations to do the right thing.
2013-07-31 13:17:50 +02:00
Eelco Dolstra
7df4ef983e Test the delayed with a bit more 2013-07-31 13:12:35 +02:00
Eelco Dolstra
0a470fc345 Make Env smaller
Commit 20866a7031 added a ‘withAttrs’
field to Env, which is annoying because it makes every Env structure
bigger and we allocate millions of them.  E.g. NixOS evaluation took
18 MiB more.  So this commit squeezes ‘withAttrs’ into values[0].
Probably should use a union...
2013-07-31 12:44:21 +02:00
Eelco Dolstra
8ae6d55db1 Don't use NULL 2013-07-31 12:11:14 +02:00
Shea Levy
e068f49f7d Avoid thunks when a fromWith var can be looked up without evaluation
Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-31 11:48:39 +02:00
Shea Levy
20866a7031 Delay evaulation of with attrs until a variable lookup needs them
Evaluation of attribute sets is strict in the attribute names, which
means immediate evaluation of `with` attribute sets rules out some
potentially interesting use cases (e.g. where the attribute names of one
set depend in some way on another but we want to bring those names into
scope for some values in the second set).

The major example of this is overridable self-referential package sets
(e.g. all-packages.nix). With immediate `with` evaluation, the only
options for such sets are to either make them non-recursive and
explicitly use the name of the overridden set in non-overridden one
every time you want to reference another package, or make the set
recursive and use the `__overrides` hack. As shown in the test case that
comes with this commit, though, delayed `with` evaluation allows a nicer
third alternative.

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-31 11:48:39 +02:00
Eelco Dolstra
70e68e0ec6 Detect stack overflows
Previously, if the Nix evaluator gets a stack overflow due to a deep
or infinite recursion in the Nix expression, the user gets an
unhelpful message ("Segmentation fault") that doesn't indicate that
the problem is in the user's code rather than Nix itself.  Now it
prints:

  error: stack overflow (possible infinite recursion)

This only works on x86_64-linux and i686-linux.

Fixes #35.
2013-07-30 23:37:10 +02:00
Shea Levy
e87d1a63bd killUser: Don't let the child kill itself on Apple
The kill(2) in Apple's libc follows POSIX semantics, which means that
kill(-1, SIGKILL) will kill the calling process too. Since nix has no
way to distinguish between the process successfully killing everything
and the process being killed by a rogue builder in that case, it can't
safely conclude that killUser was successful.

Luckily, the actual kill syscall takes a parameter that determines
whether POSIX semantics are followed, so we can call that syscall
directly and avoid the issue on Apple.

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-30 21:25:16 +02:00
Vincent Ambo
459f0433e6 emacs: Minor fixes 2013-07-30 16:19:58 +02:00
Vincent Ambo
cae07c88fd emacs: Disabled EShell banner message, amended PATH
fish: Amended PATH
2013-07-29 18:44:02 +02:00
Vincent Ambo
cdffc846bb Emacs: Various changes:
- Moved Haskell-mode configuration to customize
- Disabled Paredit in non-lisp buffers (or more explicitly: Enabled it
  in Elisp and Clojure buffers)
- Removed some custom items that I don't use anymore (e.g. Jabber-mode
  because I switched to bitlbee with rcirc)
- New packages: hi2 (Haskell indent mode revamped), browse-kill-ring
- Always enable undo-tree-mode and recentf-mode
- Keep all auto-save files in /tmp
2013-07-29 00:53:08 +02:00
Vincent Ambo
488a5c4956 Emacs: Enabling some more visual commands in EShell, set EShell config directory to ~/.config/eshell (similar to the fish dir) 2013-07-28 18:02:36 +02:00
Vincent Ambo
2f88133858 emacs: Added init-local.el loading for machine-local configuration, removed jabber (using bitlbee instead) 2013-07-25 20:22:57 +02:00
Florian Friesdorf
7cf539c728 buildenv: remove special treatment of python files
buildPythonPackage does not leave easy_install.pth and site.py
anymore. A python package that leaves these files is broken. An
exception to this is setuptoolsSite which packages setuptools'
site.py. To include it into a buildenv, this patch is even needed, not
just cosmetic.
2013-07-23 20:13:43 +02:00
Vincent Ambo
2e9b4cf111 emacs: Fixed EShell path 2013-07-22 11:43:48 +02:00
Vincent Ambo
818b2eb2d5 emacs: Eshell prompt regexp 2013-07-22 02:26:51 +02:00
Vincent Ambo
817ebc39e4 emacs: Added Jabber config 2013-07-21 15:23:35 +02:00
Vincent Ambo
16e42ba338 emacs: require eshell 2013-07-21 01:49:53 +02:00
Vincent Ambo
c6a9219ff5 emacs: Load init-eshell.el 2013-07-21 01:48:06 +02:00
Vincent Ambo
319ff395d8 emacs: Added configuration for EShell, mainly prompt and path. 2013-07-21 01:23:03 +02:00
Eelco Dolstra
7b09e9f2c4 Add hacking notes plus a script for running nix-shell 2013-07-19 16:51:31 +02:00
Eelco Dolstra
15e5ac8039 nix-shell: Set $IN_NIX_SHELL
This allows scripts to distinguish between a real build and a Nix
shell.
2013-07-19 14:32:05 +02:00
Eelco Dolstra
48858ad5ca nix-shell: Set some environment variables also set by build.cc
Setting $NIX_STORE causes the purity checks in gcc/ld-wrapper to kick
in, so that's why we unset $NIX_ENFORCE_PURITY.
2013-07-19 14:06:58 +02:00
Vincent Ambo
f61db0ceef emacs: Added functions from ESK, removed rcirc connect function, added scripts folder to load path 2013-07-19 13:57:13 +02:00
Eelco Dolstra
2bc5de8635 Rename ‘nix-build --run-env’ to ‘nix-shell’ 2013-07-19 12:02:44 +02:00
Eelco Dolstra
dc5f2e7da6 nix-build --run-env: Add a ‘--pure’ flag
This causes the environment to be (almost) cleared, thus giving a
shell that more closely resembled the actual Nix derivation.
2013-07-19 11:23:32 +02:00
Eelco Dolstra
a4921b8ceb Revert "build-remote.pl: Enforce timeouts locally"
This reverts commit 69b8f9980f.

The timeout should be enforced remotely.  Otherwise, if the garbage
collector is running either locally or remotely, if will block the
build or closure copying for some time.  If the garbage collector
takes too long, the build may time out, which is not what we want.
Also, on heavily loaded systems, copying large paths to and from the
remote machine can take a long time, also potentially resulting in a
timeout.
2013-07-18 12:52:29 +02:00
Shea Levy
16591eb3cc Allow bind-mounting regular files into the chroot
mount(2) with MS_BIND allows mounting a regular file on top of a regular
file, so there's no reason to only bind directories. This allows finer
control over just which files are and aren't included in the chroot
without having to build symlink trees or the like.

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-07-15 16:01:33 +02:00
Vincent Ambo
eadc09e76f emacs: Fixed voices 2013-07-15 13:42:08 +02:00
Vincent Ambo
9342b6e56f emacs: Added speak function 2013-07-15 13:34:18 +02:00
Vincent Ambo
23806edd3e emacs: Some bindings and word jumping 2013-07-15 01:06:32 +02:00
Vincent Ambo
a5f4b2f479 emacs: Nyan cat mode! 2013-07-15 00:02:08 +02:00
Vincent Ambo
dc0e8b9871 emacs: Add racket things 2013-07-14 23:51:01 +02:00
Vincent Ambo
d23221d243 emacs: Added a custom-git-clone function 2013-07-14 23:50:24 +02:00
Vincent Ambo
0de09c890d emacs: Changed rainbow-delimiters colours to those from Solarized
theme (very visible on Gruber Darker, I like it!) and forcing show-parens-mode
2013-07-14 18:08:44 +02:00
Eelco Dolstra
c3f5413e80 Fix syntax error in unpack-channel 2013-07-12 14:06:05 +02:00
Eelco Dolstra
aeb810b01e Garbage collector: Don't follow symlinks arbitrarily
Only indirect roots (symlinks to symlinks to the Nix store) are now
supported.
2013-07-12 14:03:36 +02:00
Gergely Risko
25a00cae5b Add gzip support for channel unpacking 2013-07-12 11:29:37 +02:00
Domen Kožar
620d57f036 doc: typo 2013-07-12 11:27:43 +02:00
Eelco Dolstra
6fcc290619 build-remote.pl: Move "building ..." message to a better place 2013-07-11 17:16:45 +02:00
Eelco Dolstra
ed09d0c0a4 nix-build --run-env: Always use Bash
Fixes #113.
Fixes #131.
2013-07-11 14:40:29 +02:00
Eelco Dolstra
656390062a nix-build --run-env: Source $stdenv/setup in the interactive shell
This ensures that not just environment variables are set, but also
shell functions such as unpackPhase, configurePhase and so on.
2013-07-11 14:32:22 +02:00
Vincent Ambo
d2311f48f6 emacs: add /usr/local/bin to emacs' $PATH 2013-07-10 14:32:09 +02:00
Vincent Ambo
f2d23b8182 fish: Set EDITOR variable and edit function to use -n and -create-frame option in emacsclient 2013-07-10 11:39:13 +02:00
Vincent Ambo
c5f6606f63 emacs: Switched font 2013-07-09 14:04:58 +02:00