Skip to content

nixos-option: update to nix 2.18#293542

Merged
mweinelt merged 1 commit intoNixOS:masterfrom
lf-:jade/update-nixos-option
Mar 5, 2024
Merged

nixos-option: update to nix 2.18#293542
mweinelt merged 1 commit intoNixOS:masterfrom
lf-:jade/update-nixos-option

Conversation

@lf-
Copy link
Copy Markdown
Member

@lf- lf- commented Mar 5, 2024

This utility has horrendous code quality, partially due to nix's fault, and really desperately needs to be rewritten, hopefully to not use the nix C++ API. Either use the Python bindings to the Nix C API when the Nix team merges the C API, or just write a clever bit of Nix script to extract the data from a config, turn it into json, then process it into good output in a CLI wrapper.

It currently does not support flakes and has many other issues. (in my testing it did not accept -I nixos-path, it exploded due to having plugins in /etc/nix/nix.conf with no way to override that (NIX_CONFIG??), among other breakage that simply does not exist in the Nix CLI).

Description of changes

I basically grepped the nix sources for invocations of all the broken functions and then guessed how to adapt the code. I have tested it manually.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This utility has horrendous code quality, partially due to nix's fault,
and really desperately needs to be rewritten, hopefully to not use the
nix C++ API. Either use the Python bindings to the Nix C API when the
Nix team merges the C API, or just write a clever bit of Nix script to
extract the data from a config, turn it into json, then process it into
good output in a CLI wrapper.

It currently does not support flakes and has many other issues.
(in my testing it did not accept -I nixos-path, it exploded due to
having plugins in /etc/nix/nix.conf with no way to override that, among
other breakage that simply does not exist in the Nix CLI).
@lf- lf- requested a review from RaitoBezarius March 5, 2024 17:19
@RaitoBezarius
Copy link
Copy Markdown
Member

Result of nixpkgs-review pr 293542 run on x86_64-linux 1

2 packages built:
  • home-manager
  • nixos-option

Copy link
Copy Markdown
Member

@mweinelt mweinelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build tested on aarch64-darwin, x86_64-darwin, aarch64-linux, x86_64-linux.

Runs, works, thank you.

@mweinelt mweinelt merged commit 0cfd293 into NixOS:master Mar 5, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2024

Successfully created backport PR for release-23.11:

@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 5, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2024

Git push to origin failed for release-23.11 with exitcode 1

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2024

Git push to origin failed for release-23.11 with exitcode 1

@lf- lf- deleted the jade/update-nixos-option branch February 5, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants