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

lib.mkRenamedOptionModule: does not handle mkForce priority #369491

Open
nbraud opened this issue Dec 30, 2024 · 0 comments
Open

lib.mkRenamedOptionModule: does not handle mkForce priority #369491

nbraud opened this issue Dec 30, 2024 · 0 comments
Labels
0.kind: bug Something is broken

Comments

@nbraud
Copy link
Contributor

nbraud commented Dec 30, 2024

Describe the bug

Evaluating a module containing renamed options (using lib.mkRenamedOptionModule) set by their old name with mkForce priority, results in the following error:

error: A definition for option `bar.enable' is not of type `boolean'. Definition values:
       - In `<unknown-file>':
           {
             _type = "override";
             content = true;
             priority = 50;
           }

Steps To Reproduce

Evaluate the following:

with (import <nixpkgs> {}).lib;
evalModules {
  modules = [{
    imports = [
      (mkRenamedOptionModule [ "foo" ] [ "bar" ])
    ];

    options.bar.enable = mkEnableOption "bar";

    config.foo.enable = mkForce true;
  }];
}

Try again without mkForce

Expected behavior

Successful evaluation, with or without mkForce.

Additional context

Encountered by a user following #369391.

Notify maintainers

@infinisil @roberth


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant