NixOS + home-manager configs, mirrored from GitLab SaaS. gitlab.com/andreijiroh-dev/nixops-config
nix-flake nixos home-manager nixpkgs nix-flakes
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(ssh-agent-loader): correct XDG_RUNTIME_DIR check and export logic

Fixed per shellcheck recommendations, alongside adding
SPDX-License-Identifier comment header

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.dev>

+6 -3
+6 -3
misc/bash/lib/ssh-agent-loader
··· 1 1 #!/usr/bin/env bash 2 + # shellcheck disable=SC2034 3 + # SPDX-License-Identifier: MPL-2.0 2 4 3 5 # Workaround in cases where XDG_RUNTIME_DIR is undefined on login 4 - if [[ ! -n "${XDG_RUNTIME_DIR}" ]]; then 6 + if [[ -z "${XDG_RUNTIME_DIR}" ]]; then 5 7 echo "warning: XDG_RUNTIME_DIR is possibly undefined, see https://github.com/swaywm/sway/issues/7202" 6 8 echo "warning: for context and https://wiki.archlinux.org/title/XDG_Base_Directory for docs" 7 9 echo "warning: setting it up for you using the default '/run/user/$(id -u)' value in 3s..." 8 10 sleep 3 9 - export XDG_RUNTIME_DIR="/run/user/$(id -u)" 11 + XDG_RUNTIME_DIR="/run/user/$(id -u)" 12 + export XDG_RUNTIME_DIR 10 13 fi 11 14 12 15 # do feature detection if keychain is installed ··· 17 20 fi 18 21 19 22 try_keychain_ssh_agent() { 20 - if [[ FF_KEYCHAIN == "1" ]]; then 23 + if [[ $FF_KEYCHAIN == "1" ]]; then 21 24 echo "[ssh-agent-loader::keychain] attempting to use keychain for SSH agents" 22 25 eval "$(keychain --eval --agents ssh,gpg)" 23 26 else