Skip to content

direnv not updated on nixos #620

Description

@mihem

@b-rodrigues while

use nix
mkdir $TMP

worked fine for me on ubuntu with direnv extension in vscode,on nixos this did not reload the direnv environment
So initially direnv loaded the correct environment and everythings works fine, but after adding a package via rix, this did not work in vscode (while it works fine via terminal). Even if i told direnv extension to reset and restart the environment, the new packages could not be loaded in the env.
LLM told me this has something to do with .envrc and wrong cache invalidation.

using .envrc

watch_file default.nix

export TMP="$PWD/.direnv/tmp"
export TMPDIR="$TMP"
mkdir -p "$TMP"

use nix

fixed it for me. Then direnv automatically asked if i want to reload the env and then new packages can be loaded.
I am not sure

export TMP="$PWD/.direnv/tmp"
export TMPDIR="$TMP"
mkdir -p "$TMP"

these lines are strictly needed?

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