Skip to content
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

Pass --accept-flake-config only during flake-related commands #361

Merged
merged 10 commits into from
Dec 16, 2024

Conversation

shivaraj-bh
Copy link
Member

@shivaraj-bh shivaraj-bh commented Dec 11, 2024

--accept-flake-config expects the flake to be already enabled, which will fail om health on systems with flake not enabled.

Error

❄️  nix --accept-flake-config --version️
Error: Unable to gather nix info

Caused by:
    0: Nix command error: Command error: Process exited unsuccessfully. exit_code=Some(1) stderr=error: experimental Nix feature 'flakes' is disabled; add '--extra-experimental-features flakes' to enable it

    1: Command error: Process exited unsuccessfully. exit_code=Some(1) stderr=error: experimental Nix feature 'flakes' is disabled; add '--extra-experimental-features flakes' to enable it

    2: Process exited unsuccessfully. exit_code=Some(1) stderr=error: experimental Nix feature 'flakes' is disabled; add '--extra-experimental-features flakes' to enable it

@srid
Copy link
Member

srid commented Dec 11, 2024

I think we should just make the default accept_flake_config to be false, and instead set it to true in with_flakes().

@shivaraj-bh
Copy link
Member Author

I think we should just make the default accept_flake_config to be false, and instead set it to true in with_flakes().

Done

@srid
Copy link
Member

srid commented Dec 15, 2024

I just realized there's another bug in main ... --accept-flake-config is not even being passed in many places! Fixing this as part of this PR ...

@srid srid changed the title nix_rs: Fix regression while fetching version and config Pass --accept-flake-config only during flake-related commands Dec 16, 2024
@srid srid merged commit e8c05e5 into main Dec 16, 2024
5 checks passed
@srid srid deleted the flake-enabled-check branch December 16, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants