Skip to content
This repository was archived by the owner on Oct 15, 2022. It is now read-only.
This repository was archived by the owner on Oct 15, 2022. It is now read-only.

lorri + direnv reloads environment after every command #499

@spacekookie

Description

@spacekookie

Describe the bug

When running a command in a directory with a lorri + direnv setup, lorri will rebuild the derivation and reload the environment, even when there were no changes to shell.nix

To Reproduce
Steps to reproduce the behavior:

  1. Create an .envrc file
eval "$(lorri direnv)"
  1. Create a shell.nix
with import <nixpkgs> {};

stdenv.mkDerivation {
  name = "work-dev";
  buildInputs = with pkgs; [
    cargo clangStdenv rust-analyzer rustc rustfmt cargo-expand

    openjdk gradle cmake elixir
  ];
}
  1. Run direnv allow
 ❤ (tempest) ~/P/c/ooo> cd ooo/                                                                                                                       
direnv: loading ~/Projects/clients/ooo/ooo/.envrc
direnv: export +AR +AS +CC +CMAKE_INCLUDE_PATH +CMAKE_LIBRARY_PATH +CMAKE_PREFIX_PATH +CONFIG_SHELL +CXX +ERL_LIBS +HOST_PATH +IN_LORRI_SHELL +IN_NIX_SHELL +JAVA_HOME +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_BUILD_TOP +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_INDENT_MAKE +NIX_LDFLAGS +NIX_LOG_FD +NIX_STORE +NM +OBJCOPY +OBJDUMP +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +allowSubstitutes +buildInputs +builder +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +extraClosure +name +nativeBuildInputs +origArgs +origBuilder +origExtraClosure +origOutputs +origPATH +origSystem +out +outputs +patches +preHook +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +stdenv +strictDeps +system ~PATH ~XDG_DATA_DIRS
 ❤ (tempest) ~/P/c/o/ooo> cat shell.nix                                                                                       lorri-keep-env-hack-ooo
with import <nixpkgs> {};

stdenv.mkDerivation {
  name = "ooo";
  buildInputs = with pkgs; [
    cargo clangStdenv rust-analyzer rustc rustfmt cargo-expand

    openjdk gradle cmake elixir
  ];
}
direnv: loading ~/Projects/clients/ooo/ooo/.envrc
direnv: export +AR +AS +CC +CMAKE_INCLUDE_PATH +CMAKE_LIBRARY_PATH +CMAKE_PREFIX_PATH +CONFIG_SHELL +CXX +ERL_LIBS +HOST_PATH +IN_LORRI_SHELL +IN_NIX_SHELL +JAVA_HOME +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_BUILD_TOP +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_INDENT_MAKE +NIX_LDFLAGS +NIX_LOG_FD +NIX_STORE +NM +OBJCOPY +OBJDUMP +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +allowSubstitutes +buildInputs +builder +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +extraClosure +name +nativeBuildInputs +origArgs +origBuilder +origExtraClosure +origOutputs +origPATH +origSystem +out +outputs +patches +preHook +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +stdenv +strictDeps +system ~PATH ~XDG_DATA_DIRS

Expected behavior

lorri rebuilds my environment whenever a change was made to shell.nix

Metadata

$ lorri info
lorri version: 1.3
GC roots exist, shell_gc_root: "/home/.cache/lorri/gc_roots/7c3b2e96948f6bb1e93d5fb988de6702/gc_root/shell_gc_root"
$ uname -a
Linux tempest 5.4.100 #1-NixOS SMP Tue Feb 23 14:02:26 UTC 2021 x86_64 GNU/Linux

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions