Skip to content

nixos/kernel: Module inclusion improvements #375975

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

Open
wants to merge 3 commits into
base: staging-next
Choose a base branch
from

Conversation

ElvishJerricco
Copy link
Contributor

@ElvishJerricco ElvishJerricco commented Jan 23, 2025

boot.initrd.allowMissingModules = true to allow a system to build even when the kernel doesn't have all the requested modules. Or boot.availableKernelModules.foo = true; to enable / disable a module.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

Add a 👍 reaction to pull requests you find important.

@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/` 6.topic: systemd labels Jan 23, 2025
@nix-owners nix-owners bot requested review from flokli, aanderse and arianvp January 23, 2025 02:34
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jan 23, 2025
@ElvishJerricco ElvishJerricco force-pushed the push-lsvukqwlwnqo branch 3 times, most recently from a82062e to 1afee75 Compare March 18, 2025 23:41
@github-actions github-actions bot added 6.topic: module system About "NixOS" module system internals 6.topic: lib The Nixpkgs function library labels Mar 18, 2025
@ElvishJerricco ElvishJerricco changed the title nixos/stage-1: Add option for allowing missing modules nixos/kernel: Module inclusion improvements Mar 18, 2025
@nix-owners nix-owners bot requested review from hsjobeki, roberth and infinisil March 18, 2025 23:43
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Mar 18, 2025
@ElvishJerricco
Copy link
Contributor Author

Targeting staging-next as I believe this will rebuild all nixos tests. It could target staging for that reason, but it would take longer to hit master that way. staging-next does not build nixos tests, meaning all nixos tests are rebuilt when staging-next is merged into master, making staging-next the ideal target for changes that only rebuild all nixos tests.

@ElvishJerricco ElvishJerricco changed the base branch from master to staging-next March 19, 2025 00:15
@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label Mar 19, 2025
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 23, 2025
Comment on lines +1165 to +1184
# A list of attrnames is coerced into an attrset of bools by
# setting the values to true.
Copy link
Member

Choose a reason for hiding this comment

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

Not to tempt contributors into improving this duplicate doc.

Suggested change
# A list of attrnames is coerced into an attrset of bools by
# setting the values to true.
/** See https://nixos.org/manual/nixos/unstable/#sec-option-types-basic */

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see any other types in this file linking to the manual like that?

Comment on lines +11 to +17
modulesTypeDesc = ''
This can either be a list of modules, or an attrset. In an
attrset, names that are set to `true` represent modules that will
be included. Note that setting these names to `false` does not
prevent the module from being loaded. For that, use
{option}`boot.blacklistedKernelModules`.
'';
Copy link
Member

Choose a reason for hiding this comment

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

Should it be coercedTo (... true) (attrsOf (enum [ true false "auto" ])) then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand. That isn't what these options do.

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 24, 2025
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 2, 2025
@ElvishJerricco
Copy link
Contributor Author

@roberth ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: lib The Nixpkgs function library 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 6.topic: systemd 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants