Skip to content

Instantly share code, notes, and snippets.

@Lillecarl
Created May 8, 2024 12:41
Show Gist options
  • Save Lillecarl/2af68098c44ef29ec6da8916c73dd4ab to your computer and use it in GitHub Desktop.
Save Lillecarl/2af68098c44ef29ec6da8916c73dd4ab to your computer and use it in GitHub Desktop.
Cached PATH from nix develop
# Cache PATH from nix develop for one hour
if ! fd --type f --hidden --quiet --changed-within 1h .nixpath
then
# shellcheck disable=2016
nix develop --profile "$PWD/.nix/profile" -c sh -c 'echo $PATH' > .nixpath
else
echo "Using cached Nix PATH"
fi
PATH_add "$(cat .nixpath)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment