flake config prompt should not be printed to stdout #1155

Closed
opened 2026-03-16 12:12:06 +00:00 by lheckemann · 1 comment
Member

Describe the bug

The settings in a flake-config prompt, e.g. lines 2 and 3 of the following:

The following settings require your decision:                                                                                                                                                                                                                                                                                  
- extra-substituters = https://helix.cachix.org                                                                                                                                                                                                                                                                                
- extra-trusted-public-keys = helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=                                                                                                                                                                                                                                  

are printed to stdout.

This means that they end up in the code that is run as shell script when running source <(nix print-dev-env).

Steps To Reproduce

  1. Run nix print-dev-env in a flake with untrusted config.

Expected behavior

Settings are printed to stderr (like the first line of the warning is), not stdout.

nix --version output

nix (Lix, like Nix) 2.95.0-pre20260309-dev_03edd9f
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/linus/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/linus/.local/share/flatpak/exports/etc/xdg/nix/nix.conf:/var/lib/flatpak/exports/etc/xdg/nix/nix.conf:/home/linus/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/linus/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/linus/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/0dx3ndwylg0n7v9bjsql25ncdn4prlgq-lix-2.95.0-pre20260309-dev_03edd9f/share

Additional context

Add any other context about the problem here.

## Describe the bug The settings in a flake-config prompt, e.g. lines 2 and 3 of the following: ``` The following settings require your decision: - extra-substituters = https://helix.cachix.org - extra-trusted-public-keys = helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs= ``` are printed to stdout. This means that they end up in the code that is run as shell script when running `source <(nix print-dev-env)`. ## Steps To Reproduce 1. Run `nix print-dev-env` in a flake with untrusted config. ## Expected behavior Settings are printed to stderr (like the first line of the warning is), not stdout. ## `nix --version` output ``` nix (Lix, like Nix) 2.95.0-pre20260309-dev_03edd9f System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/linus/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/linus/.local/share/flatpak/exports/etc/xdg/nix/nix.conf:/var/lib/flatpak/exports/etc/xdg/nix/nix.conf:/home/linus/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/linus/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/linus/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/0dx3ndwylg0n7v9bjsql25ncdn4prlgq-lix-2.95.0-pre20260309-dev_03edd9f/share ``` ## Additional context Add any other context about the problem here.
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/5379 ("libexpr: print flake config warning to stderr")
  • commit message in cl/5383 ("libexpr: print flake config warning to stderr")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/5379", "number": 5379, "kind": "commit message"}, {"backlink": "https://gerrit.lix.systems/c/lix/+/5383", "number": 5383, "kind": "commit message"}], "cl_meta": {"5379": {"change_title": "libexpr: print flake config warning to stderr"}, "5383": {"change_title": "libexpr: print flake config warning to stderr"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/5379](https://gerrit.lix.systems/c/lix/+/5379) ("libexpr: print flake config warning to stderr") * commit message in [cl/5383](https://gerrit.lix.systems/c/lix/+/5383) ("libexpr: print flake config warning to stderr")
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1155
No description provided.