Personal dotfiles for Linux, mostly for Nixpkgs/NixOS-based and Termux setups. Mirrored using GitLab's push mirroring feature. gitlab.com/andreijiroh-dev/dotfiles
linux dotfiles
2
fork

Configure Feed

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

cook things up again (also fix symlink issues with hm in the meanwhile)

+24 -207
-178
.bashrc
··· 1 - #!/usr/bin/env bash 2 - #shellcheck disable=SC1091 3 - 4 - # My base bash shell customizations outside Home Manager, to make things 5 - # portable at least. 6 - # SPDX-License-Identifier: MPL-2.0 7 - 8 - try_keychain_ssh_agent() { 9 - if [[ $FF_KEYCHAIN == "1" ]]; then 10 - echo "[ssh-agent-loader::keychain] attempting to use keychain for SSH agents" 11 - eval "$(keychain --eval --agents ssh,gpg)" 12 - fi 13 - } 14 - 15 - ssh-agent-loader() { 16 - if [[ $1 == "" || $1 == "auto" ]]; then 17 - if [[ $SSH_CONNECTION != "" ]] && [[ $VSCODE_IPC_HOOK_CLI != "" ]]; then 18 - echo "[ssh-agent-loader] automatic detection disabled while you're in a VS Code Remote SSH session" 19 - return 20 - fi 21 - 22 - export OLD_SSH_AUTH_SOCK="$SSH_AUTH_SOCK" 23 - 24 - unset SSH_AGENT_PID SSH_AUTH_SOCK 25 - if try_1password_ssh_agent; then 26 - return 27 - elif try_keychain_ssh_agent; then 28 - return 29 - else 30 - echo "[ssh-agent-loader] SSH agent seems to be failed to load at the moment" 31 - echo "[ssh-agent-loader] try again later by manually invoking the shell function" 32 - return 1 33 - fi 34 - elif [[ $1 == "1passowrd" || $1 == "op" ]]; then 35 - unset SSH_AGENT_PID SSH_AUTH_SOCK 36 - try_1password_ssh_agent 37 - elif [[ $1 == "keychain" ]]; then 38 - try_keychain_ssh_agent 39 - else 40 - echo "ssh-agent-loader [auto|[1password|op|1p]|keychain]" 41 - return 1 42 - fi 43 - } 44 - 45 - # handle 46 - hm-vars-loader() { 47 - if [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then 48 - source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" 49 - HM_SESSION_VARS_PATH="$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" 50 - HM_SESSION_VARS_LOADED=true 51 - elif [ -f "$HOME/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh" ]; then 52 - source "$HOME/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh" 53 - HM_SESSION_VARS_PATH="$HOME/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh" 54 - HM_SESSION_VARS_LOADED=true 55 - elif [ -f "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh" ]; then 56 - source "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh" 57 - HM_SESSION_VARS_PATH="/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh" 58 - HM_SESSION_VARS_LOADED=true 59 - else 60 - HM 61 - fi 62 - export HM_SESSION_VARS_LOADED HM_SESSION_VARS_PATH 63 - } 64 - 65 - ### from Debian and Ubuntu - START ### 66 - # don't put duplicate lines or lines starting with space in the history. 67 - # See bash(1) for more options 68 - HISTCONTROL=ignoreboth 69 - 70 - # append to the history file, don't overwrite it 71 - shopt -s histappend 72 - 73 - # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 74 - HISTSIZE=2500 75 - HISTFILESIZE=5000 76 - 77 - # set a fancy prompt (non-color, unless we know we "want" color) 78 - case "$TERM" in 79 - xterm-color|*-256color) color_prompt=yes;; 80 - esac 81 - 82 - # uncomment for a colored prompt, if the terminal has the capability; turned 83 - # off by default to not distract the user: the focus in a terminal window 84 - # should be on the output of commands, not on the prompt 85 - #force_color_prompt=yes 86 - 87 - if [ -n "$force_color_prompt" ]; then 88 - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then 89 - # We have color support; assume it's compliant with Ecma-48 90 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such 91 - # a case would tend to support setf rather than setaf.) 92 - color_prompt=yes 93 - else 94 - color_prompt= 95 - fi 96 - fi 97 - 98 - if [ "$color_prompt" = yes ]; then 99 - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 100 - else 101 - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 102 - fi 103 - unset color_prompt force_color_prompt 104 - 105 - # If this is an xterm set the title to user@host:dir 106 - case "$TERM" in 107 - xterm*|rxvt*) 108 - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" 109 - ;; 110 - *) 111 - ;; 112 - esac 113 - 114 - # colored GCC warnings and errors 115 - export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' 116 - 117 - # enable programmable completion features (you don't need to enable 118 - # this, if it's already enabled in /etc/bash.bashrc and /etc/profile 119 - # sources /etc/bash.bashrc). 120 - if ! shopt -oq posix; then 121 - if [ -f /usr/share/bash-completion/bash_completion ]; then 122 - . /usr/share/bash-completion/bash_completion 123 - elif [ -f /etc/bash_completion ]; then 124 - . /etc/bash_completion 125 - fi 126 - fi 127 - ### from Debian and Ubuntu - END ### 128 - 129 - # do feature detection if keychain is installed 130 - if command -v keychain >> /dev/null; then 131 - FF_KEYCHAIN=1 132 - else 133 - FF_KEYCHAIN=0 134 - fi 135 - 136 - try_1password_ssh_agent() { 137 - export OP_SSH_AUTH_SOCK="$HOME/.1password/agent.sock" 138 - if [[ ! -S "$OP_SSH_AUTH_SOCK" ]]; then 139 - echo "[ssh-agent-loader::1password] 1Password SSH agent isn't enabled or desktop app isn't installed yet" 140 - return 1 141 - fi 142 - 143 - echo "[ssh-agent-loader::1password] attempting to use 1Password SSH agent" 144 - if ! SSH_AUTH_SOCK=$OP_SSH_AUTH_SOCK ssh-add -l >> /dev/null 2>&1; then 145 - echo "[ssh-agent-loader::1password] something went wrong while checking for 1Password SSH agent availability" 146 - echo "[ssh-agent-loader::1password] unlock the desktop app first or enable SSH agent from settings" 147 - return 1 148 - fi 149 - export SSH_AUTH_SOCK=$OP_SSH_AUTH_SOCK 150 - unset OP_SSH_AUTH_SOCK 151 - } 152 - 153 - # Technically a hack in case we don't use home-manager switch 154 - if [ -L "$HOME/.nix-profile" ] && [ -e "$HOME/.nix-profile" ]; then 155 - export PATH="$HOME/.nix-profile/bin:$HOME:$PATH" 156 - hm-vars-loader 157 - fi 158 - 159 - export PATH="$HOME/bin:$HOME/.local/bin:$PATH" 160 - export DOCKER_BUILDKIT=1 161 - 162 - # Check if we're running bash shell inside VS Code and update EDITOR and 163 - # GIT_EDITOR accordingly. We'll probably figure it out for desktop, but in the 164 - # meanwhile, just stick to nano at the moment. 165 - if [[ -n $VSCODE_IPC_HOOK_CLI ]]; then 166 - EDITOR="code --wait" 167 - ssh-agent-loader auto 168 - elif [[ -n "$SSH_CONNECTION" ]]; then 169 - EDITOR="nano" 170 - ssh-agent-loader keychain 171 - else 172 - EDITOR="nano" 173 - ssh-agent-loader auto 174 - fi 175 - export EDITOR GIT_EDITOR=$EDITOR 176 - 177 - command -v direnv >> /dev/null && eval "$(direnv hook bash)" 178 - source /home/gildedguy/.config/op/plugins.sh
-29
.profile
··· 1 - #!/usr/bin/env sh 2 - 3 - # ~/.profile: executed by the command interpreter for login shells. 4 - # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login 5 - # exists. 6 - # see /usr/share/doc/bash/examples/startup-files for examples. 7 - # the files are located in the bash-doc package. 8 - 9 - # the default umask is set in /etc/profile; for setting the umask 10 - # for ssh logins, install and configure the libpam-umask package. 11 - #umask 022 12 - 13 - # if running bash 14 - if [ -n "$BASH_VERSION" ]; then 15 - # include .bashrc if it exists 16 - if [ -f "$HOME/.bashrc" ]; then 17 - . "$HOME/.bashrc" 18 - fi 19 - fi 20 - 21 - # set PATH so it includes user's private bin if it exists 22 - if [ -d "$HOME/bin" ] ; then 23 - PATH="$HOME/bin:$PATH" 24 - fi 25 - 26 - # set PATH so it includes user's private bin if it exists 27 - if [ -d "$HOME/.local/bin" ] ; then 28 - PATH="$HOME/.local/bin:$PATH" 29 - fi
+1
bin/code-tunnel
··· 1 + code-tunnel-wrapper
+23
bin/code-tunnel-wrapper
··· 1 + #!/usr/bin/env bash 2 + 3 + _vscode_cli_path_detection=$(command -v code) 4 + VSCODE_CLI_PATH=${VSCODE_CLI_PATH:-$_vscode_cli_path_detection} 5 + PARAMS="$*" 6 + 7 + error() { 8 + echo "error: $*" 9 + } 10 + 11 + if [[ "$VSCODE_CLI_PATH" == "" ]]; then 12 + error VS Code CLI is not installed or is not on PATH yet, see 13 + error https://code.visualstudio.com/docs/remote/tunnels for setup instructions 14 + exit 1 15 + fi 16 + 17 + if [[ $PARAMS == "" ]]; then 18 + echo "running code tunnel directly" 19 + exec code tunnel 20 + fi 21 + 22 + echo "passing params to 'code tunnel': $PARAMS" 23 + exec code --verbose tunnel $PARAMS