Home Explore Blog CI



nix

3rd chunk of `doc/manual/source/release-notes/rl-0.8.md`
84aa6c257e1d1b31a40d12aa395d0dedd3abbbc308c586330000000100000cd6
    application, this is easier than subscribing to a channel.

  - `nix-store -r
            PATHS` now builds all the derivations PATHS in parallel. Previously
    it did them sequentially (though exploiting possible parallelism
    between subderivations). This is nice for build farms.

  - `nix-channel` has new operations `--list` and `--remove`.

  - New ways of installing components into user environments:

      - Copy from another user environment:

            $ nix-env -i --from-profile .../other-profile firefox

      - Install a store derivation directly (bypassing the Nix
        expression language entirely):

            $ nix-env -i /nix/store/z58v41v21xd3...-aterm-2.3.1.drv

        (This is used to implement `nix-install-package`, which is
        therefore immune to evolution in the Nix expression language.)

      - Install an already built store path directly:

            $ nix-env -i /nix/store/hsyj5pbn0d9i...-aterm-2.3.1

      - Install the result of a Nix expression specified as a
        command-line argument:

            $ nix-env -f .../i686-linux.nix -i -E 'x: x.firefoxWrapper'

        The difference with the normal installation mode is that `-E`
        does not use the `name` attributes of derivations. Therefore,
        this can be used to disambiguate multiple derivations with the
        same name.

  - A hash of the contents of a store path is now stored in the database
    after a successful build. This allows you to check whether store
    paths have been tampered with: `nix-store
            --verify --check-contents`.

  - Implemented a concurrent garbage collector. It is now always safe to
    run the garbage collector, even if other Nix operations are
    happening simultaneously.

    However, there can still be GC races if you use `nix-instantiate`
    and `nix-store
                    --realise` directly to build things. To prevent races, use the
    `--add-root` flag of those commands.

  - The garbage collector now finally deletes paths in the right order
    (i.e., topologically sorted under the “references” relation), thus
    making it safe to interrupt the collector without risking a store
    that violates the closure invariant.

  - Likewise, the substitute mechanism now downloads files in the right
    order, thus preserving the closure invariant at all times.

  - The result of `nix-build` is now registered as a root of the garbage
    collector. If the `./result` link is deleted, the GC root disappears
    automatically.

  - The behaviour of the garbage collector can be changed globally by
    setting options in `/nix/etc/nix/nix.conf`.

      - `gc-keep-derivations` specifies whether deriver links should be
        followed when searching for live paths.

      - `gc-keep-outputs` specifies whether outputs of derivations
        should be followed when searching for live paths.

      - `env-keep-derivations` specifies whether user environments
        should store the paths of derivations when they are added (thus
        keeping the derivations alive).

  - New `nix-env` query flags `--drv-path` and `--out-path`.

  - `fetchurl` allows SHA-1 and SHA-256 in addition to MD5. Just specify
    the attribute `sha1` or `sha256` instead of `md5`.

  - Manual updates.

Title: Nix Enhancements: Parallel Builds, User Environment Management, Garbage Collection, and More
Summary
This section details several enhancements to Nix, including parallel building of derivations using `nix-store -r`, new operations for `nix-channel`, and improved ways to install components into user environments. It covers copying from other profiles, directly installing store derivations or paths, and using Nix expressions. Additionally, it highlights the implementation of a concurrent garbage collector, ensuring safety during simultaneous operations, and improvements to path deletion and substitute mechanisms to maintain closure invariants. The garbage collector's behavior is now configurable via `/nix/etc/nix/nix.conf`, and `fetchurl` now supports SHA-1 and SHA-256.