Add rbw SSH socket support in home-manager modules

- Introduced a new module `rbw-ssh-socket.nix` to manage SSH_AUTH_SOCK for rbw.
- Updated `default.nix` to utilize the new SSH socket variable for session management.
- Refactored Bash and Fish shell configurations to use the new module for setting SSH_AUTH_SOCK, improving maintainability and consistency across shell environments.
This commit is contained in:
2026-06-22 12:28:25 -03:00
parent 1524100ff5
commit 3b5c031619
4 changed files with 39 additions and 31 deletions
+2 -2
View File
@@ -56,14 +56,14 @@
}
{
home.packages = with pkgs; [ rbw pinentry-gtk2 ];
home.sessionVariables.SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/rbw/ssh-agent-socket";
home.sessionVariables.SSH_AUTH_SOCK = self.lib.rbwSshSocket.sessionVariable;
home.file = inventory.mkIdentityFiles selectedHosts;
programs.ssh.enable = lib.mkIf cfg.manageSshConfig false;
home.activation.rbwSshConfig = lib.mkIf cfg.manageSshConfig (lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p "$HOME/.ssh"
chmod 700 "$HOME/.ssh"
RBW_SSH_SOCK="/run/user/$(id -u)/rbw/ssh-agent-socket"
RBW_SSH_SOCK="${self.lib.rbwSshSocket.activationPath}"
cat > "$HOME/.ssh/config" <<'EOF'
${sshConfigTemplate}
EOF