Skip to content

nix flake show: Skip IFDs instead of throwing #12583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

ulucs
Copy link
Contributor

@ulucs ulucs commented Feb 28, 2025

Motivation

As mentioned in #4265 (comment), nix flake show fails if it encounters an IFD while it's trying to show the derivations inside the flake. This means that nix flake show is effectively broken if you are using IFD's in almost any place in your flake.

Context

Following --all-systems, nix flake show now shows an "omitted" message when it encounters an IFD. To this end, I gave IFD errors an explicit type that made this possible.

Example output with this patch:

git+file:///Users/ulucs/projects/flake-filter
├───checks
│   ├───aarch64-darwin
│   │   └───flake-filter omitted due to use of import from derivation
│   ├───aarch64-linux
│   │   └───flake-filter omitted (use '--all-systems' to show)
│   ├───x86_64-darwin
│   │   └───flake-filter omitted (use '--all-systems' to show)
│   └───x86_64-linux
│       └───flake-filter omitted (use '--all-systems' to show)
├───devShells
│   ├───aarch64-darwin
│   │   ├───default: development environment 'nix-shell'
│   │   └───rust: development environment 'nix-shell'
│   ├───aarch64-linux
│   │   ├───default omitted (use '--all-systems' to show)
│   │   └───rust omitted (use '--all-systems' to show)
│   ├───x86_64-darwin
│   │   ├───default omitted (use '--all-systems' to show)
│   │   └───rust omitted (use '--all-systems' to show)
│   └───x86_64-linux
│       ├───default omitted (use '--all-systems' to show)
│       └───rust omitted (use '--all-systems' to show)
└───packages
    ├───aarch64-darwin
    │   ├───default omitted due to use of import from derivation
    │   └───rust omitted due to use of import from derivation
    ├───aarch64-linux
    │   ├───default omitted (use '--all-systems' to show)
    │   └───rust omitted (use '--all-systems' to show)
    ├───x86_64-darwin
    │   ├───default omitted (use '--all-systems' to show)
    │   └───rust omitted (use '--all-systems' to show)
    └───x86_64-linux
        ├───default omitted (use '--all-systems' to show)
        └───rust omitted (use '--all-systems' to show)

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions bot added new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority labels Feb 28, 2025
@Mic92 Mic92 added this to Nix team Mar 19, 2025
@github-project-automation github-project-automation bot moved this to To triage in Nix team Mar 19, 2025
@Mic92 Mic92 moved this from To triage to ⚖ To discuss in Nix team Mar 19, 2025
@Mic92 Mic92 moved this from ⚖ To discuss to To triage in Nix team Mar 19, 2025
@tomberek
Copy link
Contributor

From meeting:

Not sure about adding a dedicated flag that is so similar to an existing flag + option. Let's start with only the descriptive warning that the output is omitted.

@tomberek tomberek moved this from To triage to 🏁 Review in Nix team Mar 19, 2025
@Mic92 Mic92 force-pushed the ulucs/skip-ifds branch from bef2230 to fcf5966 Compare March 27, 2025 10:19
@Mic92 Mic92 enabled auto-merge March 27, 2025 10:20
@Mic92 Mic92 merged commit ca165f0 into NixOS:master Mar 27, 2025
12 checks passed
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-2-29-0-released/64609/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants