Skip to content

Evaluation dependence on external tools: docs, purity, fallbacks #1833

Closed as not planned

Description

@dtzWill

Various functionality provided by Nix tools and builtins relies on the presence and "correct" functionality of external tools.

This seems... unfortunate 😇 .

The biggest issue is one of simple usability: evaluation failures due to missing tools are a bad experience and it's not always obvious, trivial, or convenient to manipulate the environment of the Nix-based process you're interacting with to properly resolve them.

As an example, nix-based services (such as the auto-upgrader) will fail to evaluate expressions using builtins.fetchGit and fixing it requires modifying the service configuration to add required tools to the service's PATH.

Additional related issues:

  • The full list of tools required to make use of builtin Nix functionality is not available AFAICT (although this is easily fixed)
  • Reliance on these tools makes Nix evaluation "brittle" in a very (IMHO) non-Nix way--consider attempting to use Nix itself in a sandbox.
  • Reliability and purity: tools found may have different behavior than those expected and tested against (newer, older, bugged, malicious replacements).

I'm not sure of the best solution here, especially considering concerns about closure size and ease of deployment (being self-contained is rather useful here).

It's not perfect but best proposal I have is to replace all external programs with use of (mandatory?) libraries.

Thoughts? :)

Activity

  1. lheckemann commented on Feb 1, 2018

    @lheckemann
    Member

    As a sort of compromise, maybe we could produce wrappers for nix that set add the appropriate tools to PATH, and make the default nix in nixpkgs such a wrapped one? This would allow a reduced closure size while enabling all the functionality to work by default.

  2. copumpkin commented on Feb 1, 2018

    @copumpkin
    Member

    I submitted this a while back, which could be relevant: #1345

  3. copumpkin commented on Feb 1, 2018

    @copumpkin
    Member

    One thing that might be nice is a first-class building block for optional external dependencies in Nix code, that would let us enumerate them and detect early if they're available or not, to emit warnings/errors.

  4. self-assigned this
    on Apr 1, 2018
  5. stale commented on Feb 14, 2021

    @stale

    I marked this as stale due to inactivity. → More info

  6. added
    UX
    language
    and removed on Sep 13, 2022
  7. tomberek commented on Aug 13, 2026

    @tomberek
    Contributor

    Closing as stale. Re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

UXlanguage

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions