bash-prompt-prefix wrongly produces experimental feature warning due to ordering weirdness #833

Open
opened 2025-05-16 00:16:40 +00:00 by jade · 0 comments
Owner

Due to weirdness in config loading ordering, user config files aren't considered when producing experimental feature warnings for settings in global config files.

I don't know if this is even really a bug, since there are instances where the warning could be true e.g. while running as root without the user config. Nevertheless.

Steps to reproduce:

$ NIX_CONF_DIR=/tmp/sysconf NIX_USER_CONF_FILES=/tmp/userconf/nix.conf nix shell nixpkgs#hello -c hello
warning: Ignoring setting 'bash-prompt-suffix' because experimental feature 'nix-command' is not enabled
Hello, world!

$ cat /tmp/sysconf/nix.conf
bash-prompt-suffix = meow

$ cat /tmp/userconf/nix.conf
experimental-features = nix-command flakes

This does not happen if both settings are in the same file. We also don't track the provenance of config settings, which is kind of bothersome since the warnings aren't very good. I'll file a separate bug about that.

Reproduces on 2.93.0

Due to weirdness in config loading ordering, user config files aren't considered when producing experimental feature warnings for settings in global config files. I don't know if this is even *really* a bug, since there are instances where the warning *could* be true e.g. while running as root without the user config. Nevertheless. Steps to reproduce: ``` $ NIX_CONF_DIR=/tmp/sysconf NIX_USER_CONF_FILES=/tmp/userconf/nix.conf nix shell nixpkgs#hello -c hello warning: Ignoring setting 'bash-prompt-suffix' because experimental feature 'nix-command' is not enabled Hello, world! $ cat /tmp/sysconf/nix.conf bash-prompt-suffix = meow $ cat /tmp/userconf/nix.conf experimental-features = nix-command flakes ``` This does not happen if both settings are in the same file. We also don't track the provenance of config settings, which is kind of bothersome since the warnings aren't very good. I'll file a separate bug about that. Reproduces on 2.93.0
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#833
No description provided.