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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user