"error: '--arg' and '--argstr' are incompatible with flakes" when not using a flake with nix develop #658

Open
opened 2025-02-05 00:04:21 +00:00 by jade · 1 comment
Owner

Describe the bug

Nonsense error that --arg is not supported with flakes in spite of not using one.

Steps To Reproduce

$ nix develop --impure --argstr pname hello --expr '{pname}: with import <nixpkgs> {}; pkgs.${pname}'
error (ignored): error: '--arg' and '--argstr' are incompatible with flakes

Expected behavior

Should not generate garbage error.

nix --version output

nix (Lix, like Nix) 2.93.0-dev-pre20250201-a513806
System type: aarch64-darwin
Additional system types: x86_64-darwin
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /Users/jade/.config/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/g02blypc82xcxnmckvy0mr5789lgjy1k-lix-2.93.0-dev-pre20250201-a513806/share

Additional context

Add any other context about the problem here.

## Describe the bug Nonsense error that `--arg` is not supported with flakes in spite of not using one. ## Steps To Reproduce ``` $ nix develop --impure --argstr pname hello --expr '{pname}: with import <nixpkgs> {}; pkgs.${pname}' error (ignored): error: '--arg' and '--argstr' are incompatible with flakes ``` ## Expected behavior Should not generate garbage error. ## `nix --version` output ``` nix (Lix, like Nix) 2.93.0-dev-pre20250201-a513806 System type: aarch64-darwin Additional system types: x86_64-darwin Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /Users/jade/.config/nix/nix.conf:/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/g02blypc82xcxnmckvy0mr5789lgjy1k-lix-2.93.0-dev-pre20250201-a513806/share ``` ## Additional context Add any other context about the problem here.
jade changed title from "error: '--arg' and '--argstr' are incompatible with flakes" when not using a flake to "error: '--arg' and '--argstr' are incompatible with flakes" when not using a flake with nix develop 2025-02-05 00:04:37 +00:00
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/2609 ("don't error on --argstr/--arg when a command is using an expression or file instead of a flake installable")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/2609", "number": 2609, "kind": "commit message"}], "cl_meta": {"2609": {"change_title": "don't error on `--argstr`/`--arg` when a command is using an expression or file instead of a flake installable"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/2609](https://gerrit.lix.systems/c/lix/+/2609) ("don't error on `--argstr`/`--arg` when a command is using an expression or file instead of a flake installable")
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#658
No description provided.