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

Fix atuin daemon on darwin #6248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

utkarshgupta137
Copy link
Contributor

@utkarshgupta137 utkarshgupta137 commented Dec 31, 2024

Description

With atuin 18.4.0, it looks for the socket file in XDG_RUNTIME_DIR by default. But the launchd daemon we run doesn't have access to that variable, so it is created at the default socket_path which is XDG_DATA_HOME/atuin.
To fix this, we provide a default value for the socket path which is XDG_DATA_HOME/atuin/daemon.sock

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@hawkw @water-sucks

Copy link
Member

@rycee rycee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. Added a few comments.

modules/misc/xdg.nix Outdated Show resolved Hide resolved
modules/programs/atuin.nix Outdated Show resolved Hide resolved
@utkarshgupta137 utkarshgupta137 force-pushed the fix/atuin branch 2 times, most recently from 47df502 to 6f3749b Compare January 4, 2025 02:39
The daemon doesn't know about XDG_RUNTIME_DIR, so set the socket_path
manually for consistency between daemon & client
@water-sucks
Copy link
Contributor

@rycee In my original PR, I went with letting atuin configure the daemon socket path itself at .local/share/atuin/atuin.sock due to this very issue of launchd not seeing XDG variables.

AFAIK it used to fall back to this path if XDG_RUNTIME_DIR is not found, but @utkarshgupta137 is right about atuin using XDG_RUNTIME_DIR only though from 18.4.0 onward (https://github.com/atuinsh/atuin/blob/05aec6f8d60409af0f58942e1550e1a6a3b3b0ce/crates/atuin-client/src/settings.rs#L730), which is quite the change, but I digress.

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

Successfully merging this pull request may close these issues.

3 participants