Skip to content

nixos/nixpkgs: Don't check when _module.args.pkgs is set#238136

Merged
roberth merged 4 commits intoNixOS:masterfrom
hercules-ci:nixos-nixpkgs-dont-check-when-_module.args.pkgs-is-set
Jun 23, 2023
Merged

nixos/nixpkgs: Don't check when _module.args.pkgs is set#238136
roberth merged 4 commits intoNixOS:masterfrom
hercules-ci:nixos-nixpkgs-dont-check-when-_module.args.pkgs-is-set

Conversation

@roberth
Copy link
Member

@roberth roberth commented Jun 16, 2023

Description of changes

This solves a previously unsolved problem:

determining whether _module.args.pkgs
is defined elsewhere does not seem feasible.

Fixes at least part of the problem experienced here #237427 (comment)

Changes:

  • Add a function to give access to priority values for the individual attributes of an attrsOf option.
  • Handle _module.args.pkgs = lib.mkForce foo correctly in the NixOS nixpkgs.nix module assertions.
  • Make it so that finalPkgs isn't evaluated when an override like previous point is set.
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.11 Release Notes (or backporting 23.05 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.

roberth added 3 commits June 16, 2023 21:46
This will let us make assertions involving _module.args.pkgs, which
is not an option but a value attribute, and therefore doesn't have
its own highestPrio to inspect. The new function gives us that info.
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jun 16, 2023
@roberth roberth added 6.topic: module system About "NixOS" module system internals backport release-23.05 and removed 8.has: module (update) This PR changes an existing module in `nixos/` labels Jun 16, 2023
@github-actions github-actions bot added the 8.has: module (update) This PR changes an existing module in `nixos/` label Jun 23, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jun 23, 2023
@roberth
Copy link
Member Author

roberth commented Jun 23, 2023

This appears to be more urgent than I have previously assumed. Meanwhile the only person I'd expect to be able to readily review this is @infinisil who I believe is either on holiday or preparing to leave now. (I'll be happy to address anything that I might have missed)
Things being what they are, I will take the responsibility to merge this, as leaving the problem unsolved for an extended amount of time would be more harmful than the small risk of introducing a bug with this.
I've review this code myself after a week of it being up for review. Not great, but better than nothing.
If my self review proves to be mistaken, feel free to revert this PR if that solves your problem.

@github-actions
Copy link
Contributor

Successfully created backport PR for release-23.05:

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

Labels

6.topic: module system About "NixOS" module system internals 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any 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.

1 participant