Skip to content

nix flake show: Skip IFDs instead of throwing#12583

Merged
Mic92 merged 1 commit into
NixOS:masterfrom
ulucs:ulucs/skip-ifds
Mar 27, 2025
Merged

nix flake show: Skip IFDs instead of throwing#12583
Mic92 merged 1 commit into
NixOS:masterfrom
ulucs:ulucs/skip-ifds

Conversation

@ulucs

@ulucs ulucs commented Feb 28, 2025

Copy link
Copy Markdown
Contributor

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
Comment thread src/nix/flake.cc Outdated
@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
Copy Markdown
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
@nixos-discourse

Copy link
Copy Markdown

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