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

gpg-agent: fix compatibility with sh when enableSshSupport #6287

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

DDoSolitary
Copy link
Contributor

@DDoSolitary DDoSolitary commented Jan 8, 2025

Description

When services.gpg-agent.enableSshSupport is set, the module adds script to home.sessionVariablesExtra with non-portable double bracket [[ syntax.

The script is written to hm-session-vars.sh, which will be referenced by ~/.profile (if managed by home-manager) and sourced by sh which doesn't support this syntax. (e.g. when logging in graphical session with uwsm, it uses sh to source ~/.profile to get environment variables)

The portable single bracket [ syntax also supports the -z operator, so we can just use it instead.

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

@rycee

@teto teto merged commit 45bcdbc into nix-community:master Jan 8, 2025
3 checks passed
@DDoSolitary DDoSolitary deleted the fix-gpg-ssh-sh branch January 8, 2025 16:36
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.

2 participants