Home Explore Blog CI



nix

3rd chunk of `doc/manual/source/release-notes/rl-1.7.md`
d2ce37239d0e84dce0df1c575e4439f2b1111ef20167f08c0000000100000bc2
    `build-chroot-dirs`, Nix will mount a private `devpts` filesystem on
    the chroot’s `/dev/pts`.

  - New built-in function: `builtins.toJSON`, which returns a JSON
    representation of a value.

  - `nix-env -q` has a new flag `--json` to print a JSON representation
    of the installed or available packages.

  - `nix-env` now supports meta attributes with more complex values,
    such as attribute sets.

  - The `-A` flag now allows attribute names with dots in them, e.g.
    
        $ nix-instantiate --eval '<nixos>' -A 'config.systemd.units."nscd.service".text'

  - The `--max-freed` option to `nix-store --gc` now accepts a unit
    specifier. For example, `nix-store --gc --max-freed
                    1G` will free up to 1 gigabyte of disk space.

  - `nix-collect-garbage` has a new flag `--delete-older-than` *N*`d`,
    which deletes all user environment generations older than *N* days.
    Likewise, `nix-env
                    --delete-generations` accepts a *N*`d` age limit.

  - Nix now heuristically detects whether a build failure was due to a
    disk-full condition. In that case, the build is not flagged as
    “permanently failed”. This is mostly useful for Hydra, which needs
    to distinguish between permanent and transient build failures.

  - There is a new symbol `__curPos` that expands to an attribute set
    containing its file name and line and column numbers, e.g. `{ file =
    "foo.nix"; line = 10;
                    column = 5; }`. There also is a new builtin function,
    `unsafeGetAttrPos`, that returns the position of an attribute. This
    is used by Nixpkgs to provide location information in error
    messages, e.g.
    
        $ nix-build '<nixpkgs>' -A libreoffice --argstr system x86_64-darwin
        error: the package ‘libreoffice-4.0.5.2’ in ‘.../applications/office/libreoffice/default.nix:263’
          is not supported on ‘x86_64-darwin’

  - The garbage collector is now more concurrent with other Nix
    processes because it releases certain locks earlier.

  - The binary tarball installer has been improved. You can now install
    Nix by running:
    
        $ bash <(curl -L https://nixos.org/nix/install)

  - More evaluation errors include position information. For instance,
    selecting a missing attribute will print something like
    
        error: attribute `nixUnstabl' missing, at /etc/nixos/configurations/misc/eelco/mandark.nix:216:15

  - The command `nix-setuid-helper` is gone.

  - Nix no longer uses Automake, but instead has a non-recursive, GNU
    Make-based build system.

  - All installed libraries now have the prefix `libnix`. In particular,
    this gets rid of `libutil`, which could clash with libraries with
    the same name from other packages.

  - Nix now requires a compiler that supports C++11.

This release has contributions from Danny Wilson, Domen Kožar, Eelco
Dolstra, Ian-Woo Kim, Ludovic Courtès, Maxim Ivanov, Petr Rockai,
Ricardo M. Correia and Shea Levy.

Title: Nix Enhancements: Error Handling, Installation, and Library Updates
Summary
This section highlights additional Nix improvements including private `devpts` mounting in chroots, `builtins.toJSON`, a `--json` flag for `nix-env -q`, enhanced meta attribute support, and the `-A` flag allowing dotted attribute names. It also includes unit specifiers for `--max-freed` in `nix-store --gc`, a `--delete-older-than` flag for garbage collection, and heuristics for detecting disk-full build failures. The update introduces `__curPos` and `unsafeGetAttrPos` for improved error messages, increased garbage collector concurrency, and an improved binary tarball installer. Evaluation errors now include position information. The `nix-setuid-helper` command is removed, Nix no longer uses Automake, and installed libraries are prefixed with `libnix`. Finally, Nix now requires a C++11 compiler, with contributions from various developers.