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
Error description for option conflicts #15747
Comments
cc @nbp |
Thanks for the report, about the fact that NixOS error messages do not describe any way to solve the issue which is reported. I will look into it. |
Sometimes it even don't describe where the issue is, like:
I would consider My code: configuration.nix
../gvm-test-target-container/configuration.nix
|
The error can be reproduced like: ``` $ nix-instantiate ./nixos -A system --arg configuration ' { fileSystems."/".device = "nodev"; boot.loader.grub.devices = [ "nodev" ]; containers.t.config.imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ]; }' ``` Previously error was: ``` error: The unique option `containers.t.networking.hostName' is defined multiple times, in `/nix/var/nix/profiles/per-user/root/channels/nixpkgs/nixos/modules/virtualisation/amazon-image.nix' and `module at /home/danbst/dev/nixpkgs/nixos/modules/virtualisation/containers.nix:470'. (use '--show-trace' to show detailed location information) ``` Now it is: ``` error: The unique option `containers.t.networking.hostName' is defined multiple times, in: - /nix/var/nix/profiles/per-user/root/channels/nixpkgs/nixos/modules/virtualisation/amazon-image.nix - module at /home/danbst/dev/nixpkgs/nixos/modules/virtualisation/containers.nix:470. (use '--show-trace' to show detailed location information) ``` Related: NixOS#15747
See NixOS#15747. Previously this module was called `<unknown-file>` in error messages, now it is called a bit more close to real: ``` module at /home/danbst/dev/nixpkgs/nixos/modules/virtualisation/containers.nix:470 ```
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
It would still be helpful to get a more actionable error message here. In particular something pointing users towards |
I marked this as stale due to inactivity. → More info |
Still an issue. |
I marked this as stale due to inactivity. → More info |
Still an issue, yes. I found my way to this issue while looking for advice about tracking down an |
Issue description
I think, that error description for module options conflict is not newbie friendly. At least it should mention the ways to solve this conflict, e.g.
lib.mkForce
orlib.mkOverride
. For example, you cannot set this optionSteps to reproduce
module1:
module2:
results into
Example 2: one-liner
Technical details
The text was updated successfully, but these errors were encountered: