[Nix#8753] :reload in the REPL removes everything loaded with :lf #128

Open
opened 2024-03-16 06:45:03 +00:00 by lix-bot · 0 comments
Member

Upstream-Issue: NixOS/nix#8753

If a flake is loaded with :lf in the repl, then running :r will drop it from the environment rather than reloading it:

$ nix repl
Welcome to Nix 2.17.0pre20230720_85d0eb6. Type :? for help.

nix-repl> :lf nixpkgs    
Added 15 variables.

nix-repl> builtins.attrNames legacyPackages 
[ "aarch64-darwin" "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "i686-linux" "mipsel-linux" "powerpc64le-linux" "riscv64-linux" "x86_64-darwin" "x86_64-linux" ]

nix-repl> :r                                

nix-repl> builtins.attrNames legacyPackages
error: undefined variable 'legacyPackages'

       at «string»:1:20:

            1| builtins.attrNames legacyPackages
             |                    ^

This doesn't affect :l

Upstream-Issue: https://git.lix.systems/NixOS/nix/issues/8753 If a flake is loaded with `:lf` in the repl, then running `:r` will drop it from the environment rather than reloading it: ```console $ nix repl Welcome to Nix 2.17.0pre20230720_85d0eb6. Type :? for help. nix-repl> :lf nixpkgs Added 15 variables. nix-repl> builtins.attrNames legacyPackages [ "aarch64-darwin" "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "i686-linux" "mipsel-linux" "powerpc64le-linux" "riscv64-linux" "x86_64-darwin" "x86_64-linux" ] nix-repl> :r nix-repl> builtins.attrNames legacyPackages error: undefined variable 'legacyPackages' at «string»:1:20: 1| builtins.attrNames legacyPackages | ^ ``` This doesn't affect `:l`
lix-bot added the
bug
imported
labels 2024-03-16 06:45:03 +00:00
winter self-assigned this 2024-03-27 15:27:06 +00:00
jade added the
Area/flakes
label 2024-03-30 00:04:22 +00:00
winter removed their assignment 2024-04-17 01:21:16 +00:00
jade added the
Area/repl
label 2024-05-30 07:12:29 +00:00
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#128
No description provided.