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

Caching on a read-only setup #5

Open
bestlem opened this issue Jan 6, 2024 · 3 comments
Open

Caching on a read-only setup #5

bestlem opened this issue Jan 6, 2024 · 3 comments

Comments

@bestlem
Copy link

bestlem commented Jan 6, 2024

I am trying to use oxide under a nix based system.

The nix build puts the config files in a read-only file system.

Thus on start I get there error

xontrib-zoxide: creating a zoxide init cache file too speed up subsequent loads
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
PermissionError: [Errno 13] Permission denied: '/nix/store/8pgrl3sqd1pndwmg2zjx0n7ip5lby2ji-python3-3.11.6-env/lib/python3.11/site-packages/xontrib/zoxide/zoxide_init_cache.py'
Failed to load xontrib zoxide.

Is it possible to create the cache code in the setup phase rather than at run-time - or at least put the files in $XDG_CACHE_HOME

@dyuri
Copy link
Owner

dyuri commented Jan 6, 2024

Yes, it would be definitely possible to use $XDG_CACHE_HOME (if set, if not (for windows/macos) the current location should be fine). PR welcome!

@dedguy21
Copy link

dedguy21 commented Apr 7, 2024

@bestlem I'm new to NixOS and while I've been able to add packages from the xonsh repo (vox and fish_completer) I haven't been able to add xontrib-zoxide without error. Do you mind sharing your script for getting it built accurately 🙏

@bestlem
Copy link
Author

bestlem commented Apr 7, 2024

@dedguy21 Sorry I did not produce a solution - I just put the code in my initialisation.
It is just the code from earlier versions and the zoxide github

execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide')

I have no idea what the extra code is meant to do so I could not try to use it. The change needs to be explained.

Also you put caches in ~/.cache or ~/Library/Caches and never in ~/.config - thus I have to suspect the quality of the changes as they would never have passed a code review I was involved in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants