A modern, delicious implementation of the Nix package manager, focused on correctness, usability, and growth — and committed to doing right by its community https://lix.systems
Go to file
Rebecca Turner 9e7e927837 Print top-level errors normally in nix repl
Previously, errors while printing values in `nix repl` would be printed
in `«error: ...»` brackets rather than displayed normally:

```
nix-repl> legacyPackages.aarch64-darwin.pythonPackages.APScheduler
«error: Package ‘python-2.7.18.7’ in /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/pkgs/development/interpreters/python/cpython/2.7/default.nix:335 is marked as insecure, refusing to evaluate.»
```

Now, errors will be displayed normally if they're emitted at the
top-level of an expression:

```
nix-repl> legacyPackages.aarch64-darwin.pythonPackages.APScheduler
error:
       … in the condition of the assert statement
         at /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/lib/customisation.nix:268:17:
          267|     in commonAttrs // {
          268|       drvPath = assert condition; drv.drvPath;
             |                 ^
          269|       outPath = assert condition; drv.outPath;

       … in the left operand of the OR (||) operator
         at /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/pkgs/development/interpreters/python/passthrufun.nix:28:45:
           27|         if lib.isDerivation value then
           28|           lib.extendDerivation (valid value || throw "${name} should use `buildPythonPackage` or `toPythonModule` if it is to be part of the Python packages set.") {} value
             |                                             ^
           29|         else

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: Package ‘python-2.7.18.7’ in /nix/store/6s0m1qc31zw3l3kq0q4wd5cp3lqpkq0q-source/pkgs/development/interpreters/python/cpython/2.7/default.nix:335 is marked as insecure, refusing to evaluate.
```

Errors emitted in nested structures (like e.g. when printing `nixpkgs`)
will still be printed in brackets.

Change-Id: I25aeddf08c017582718cb9772a677bf51b9fc2ad
2024-04-09 08:34:40 -07:00
.github Add pre-commit checks 2024-03-29 22:57:40 -07:00
bench Add benchmarking scripts 2024-04-08 19:50:24 -07:00
clang-tidy Create clang-tidy check to rename all our includes 2024-04-06 04:40:19 +00:00
contrib function-trace: always show the trace 2019-09-18 23:23:21 +02:00
doc Print top-level errors normally in nix repl 2024-04-09 08:34:40 -07:00
lix-doc Format Nix code with nixfmt 2024-04-08 13:00:00 -07:00
m4 Merge pull request #6258 from obsidiansystems/gcc-bug-ergonomics 2024-03-04 05:24:33 +01:00
maintainers docs: don't compute rl-next.md during build 2024-04-09 02:09:36 +00:00
meson Add pre-commit checks 2024-03-29 22:57:40 -07:00
misc Format Nix code with nixfmt 2024-04-08 13:00:00 -07:00
mk Build with traps on signed overflow 2024-03-27 23:54:04 -07:00
nix-support Add nixfmt 2024-04-08 09:42:34 -07:00
perl Format Nix code with nixfmt 2024-04-08 13:00:00 -07:00
scripts meson: install shell files 2024-03-29 20:10:33 +00:00
src Print top-level errors normally in nix repl 2024-04-09 08:34:40 -07:00
tests Print top-level errors normally in nix repl 2024-04-09 08:34:40 -07:00
.clang-format Add pre-commit checks 2024-03-29 22:57:40 -07:00
.clang-tidy Add basic clang-tidy config 2024-03-29 20:26:38 -07:00
.dir-locals.el .dir-locals.el: Set c-block-comment-prefix 2020-07-10 11:21:06 +02:00
.editorconfig Add .editorconfig 2017-06-05 22:57:28 +01:00
.envrc Set MAKEFLAGS=-j and GTEST_BRIEF in .envrc 2024-03-28 18:17:28 -07:00
.gitignore docs: don't compute SUMMARY.md during build 2024-04-09 02:09:36 +00:00
.version Update version to 2.90.0 2024-03-07 19:57:39 -07:00
boehmgc-coroutine-sp-fallback.diff Add pre-commit checks 2024-03-29 22:57:40 -07:00
boehmgc-traceable_allocator-public.diff Add pre-commit checks 2024-03-29 22:57:40 -07:00
configure.ac Stop vendoring toml11 2024-03-27 21:04:00 -04:00
CONTRIBUTING.md Put functional tests in tests/functional 2023-12-01 12:06:43 -05:00
COPYING Add pre-commit checks 2024-03-29 22:57:40 -07:00
default.nix Format Nix code with nixfmt 2024-04-08 13:00:00 -07:00
docker.nix Format Nix code with nixfmt 2024-04-08 13:00:00 -07:00
flake.lock pre-commit: stop using the flake 2024-04-08 15:29:23 -07:00
flake.nix pre-commit check for pragma once and ///@file 2024-04-08 16:10:57 -07:00
justfile Add a justfile to make meson friendly :) 2024-03-30 03:03:46 +00:00
local.mk build: enable libstdc++ assertions 2024-04-08 15:40:12 -07:00
Makefile un-ups your start 2024-03-18 18:28:08 -07:00
Makefile.config.in nix-doc -> lix-doc, make self-contained in package.nix 2024-04-08 04:05:13 +00:00
meson.build build: enable libstdc++ assertions 2024-04-08 15:40:12 -07:00
meson.options meson: add switch to disable docs 2024-04-01 20:15:28 +00:00
package.nix Format Nix code with nixfmt 2024-04-08 13:00:00 -07:00
precompiled-headers.h Config: Use nlohmann/json 2020-08-20 11:02:16 +02:00
README.md Improve hacking.md 2023-02-13 12:00:00 +04:00
shell.nix Remove url literals 2022-01-24 13:28:21 +01:00
treefmt.toml Format Nix code with nixfmt 2024-04-08 13:00:00 -07:00

Nix

Open Collective supporters Test

Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Please refer to the Nix manual for more details.

Installation

On Linux and macOS the easiest way to install Nix is to run the following shell command (as a user other than root):

$ curl -L https://nixos.org/nix/install | sh

Information on additional installation methods is available on the Nix download page.

Building And Developing

See our Hacking guide in our manual for instruction on how to to set up a development environment and build Nix from source.

Additional Resources

License

Nix is released under the LGPL v2.1.