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

nix repl ignores --override-input #7859

Open
DavHau opened this issue Feb 19, 2023 · 1 comment
Open

nix repl ignores --override-input #7859

DavHau opened this issue Feb 19, 2023 · 1 comment
Labels
bug flakes new-cli Relating to the "nix" command repl The Read Eval Print Loop, "nix repl" command and debugger

Comments

@DavHau
Copy link
Member

DavHau commented Feb 19, 2023

Describe the bug

When nix repl is called with experimental features flakes and nix-command, it ignores the --override-input argument.

Steps To Reproduce

grmpf@grmpf-nix /tmp> git clone https://github.com/numtide/srvos
grmpf@grmpf-nix /tmp> cd srvos/
grmpf@grmpf-nix /t/srvos (main)> nix repl --override-input nixpkgs nixpkgs/nixos-20.03
Welcome to Nix 2.13.1. Type :? for help.

nix-repl> :lf ./.
Added 15 variables.

nix-repl> inputs.nixpkgs.lib.nixpkgsVersion
trace: `lib.nixpkgsVersion` is deprecated, use `lib.version` instead!
"23.05pre-git"

Expected behavior

nix repl respecting --override-input

nix-env --version output
nix-env (Nix) 2.13.1

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

@DavHau DavHau added the bug label Feb 19, 2023
@roberth roberth added new-cli Relating to the "nix" command flakes labels Mar 16, 2023
@balsoft
Copy link
Member

balsoft commented Mar 22, 2023

I think "respecting" in this case should mean "failing with an error". It doesn't make sense to have an override-input when no flake is being passed on the command line. Note that with repl-flake experimental feature it does work correctly:

❯ nix repl --extra-experimental-features 'repl-flake' ./projects/nix --override-input nixpkgs ./projects/nixpkgs
Welcome to Nix 2.14.0pre20230213_c205d10. Type :? for help.

warning: Git tree '/home/balsoft/projects/nix' is dirty
warning: Git tree '/home/balsoft/projects/nixpkgs' is dirty
warning: not writing modified lock file of flake 'git+file:///home/balsoft/projects/nix':
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/04a75b2eecc0acf6239acf9dd04485ff8d14f425' (2022-12-08)
  → 'git+file:///home/balsoft/projects/nixpkgs' (2023-03-14)
Loading installable 'git+file:///home/balsoft/projects/nix#'...
Added 6 variables.

@roberth roberth added the repl The Read Eval Print Loop, "nix repl" command and debugger label Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug flakes new-cli Relating to the "nix" command repl The Read Eval Print Loop, "nix repl" command and debugger
Projects
None yet
Development

No branches or pull requests

3 participants