mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 03:33:03 +03:00
console: use ssh-agent from systemd
This commit is contained in:
parent
2247f9f322
commit
7ec9be8808
3 changed files with 29 additions and 28 deletions
18
.profile
18
.profile
|
|
@ -34,21 +34,9 @@ fi
|
||||||
# My paths:1 ends here
|
# My paths:1 ends here
|
||||||
|
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# [[file:Console.org::*ssh-agent][ssh-agent:1]]
|
# [[file:Console.org::*ssh-agent][ssh-agent:3]]
|
||||||
SSH_AGENT_DIR="/tmp"
|
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket
|
||||||
|
# ssh-agent:3 ends here
|
||||||
if [ "$IS_ANDROID" == "true" ]; then
|
|
||||||
SSH_AGENT_DIR="/data/data/com.termux/files/tmp"
|
|
||||||
mkdir -p $SSH_AGENT_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
|
|
||||||
ssh-agent -t 1h > "$SSH_AGENT_DIR/ssh-agent.env"
|
|
||||||
fi
|
|
||||||
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
|
|
||||||
source "$SSH_AGENT_DIR/ssh-agent.env" >/dev/null
|
|
||||||
fi
|
|
||||||
# ssh-agent:1 ends here
|
|
||||||
|
|
||||||
# [[file:Console.org::*Misc settings][Misc settings:1]]
|
# [[file:Console.org::*Misc settings][Misc settings:1]]
|
||||||
export JUPYTER_CONFIG_DIR=$HOME/.config/jupyter
|
export JUPYTER_CONFIG_DIR=$HOME/.config/jupyter
|
||||||
|
|
|
||||||
6
Arch.org
6
Arch.org
|
|
@ -64,6 +64,12 @@ gpg --edit-key <keyname>
|
||||||
trust
|
trust
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Also the following to =~/.ssh/config=:
|
||||||
|
#+begin_src conf-space
|
||||||
|
Host *
|
||||||
|
AddKeysToAgent yes
|
||||||
|
#+end_src
|
||||||
|
|
||||||
Then, clone the dotfiles repo with =yadm=:
|
Then, clone the dotfiles repo with =yadm=:
|
||||||
#+begin_src bash
|
#+begin_src bash
|
||||||
yadm clone git@github.com:SqrtMinusOne/dotfiles.git
|
yadm clone git@github.com:SqrtMinusOne/dotfiles.git
|
||||||
|
|
|
||||||
33
Console.org
33
Console.org
|
|
@ -87,9 +87,8 @@ fi
|
||||||
** ssh-agent
|
** ssh-agent
|
||||||
I'm paranoid so I encrypt my SSH keys.
|
I'm paranoid so I encrypt my SSH keys.
|
||||||
|
|
||||||
Got the idea for below from [[https://wiki.archlinux.org/title/SSH_keys#SSH_agents][ArchWiki]]:
|
I used to do the below, as instructed by [[https://wiki.archlinux.org/title/SSH_keys#SSH_agents][ArchWiki]]:
|
||||||
|
#+begin_src bash :tangle no
|
||||||
#+begin_src bash
|
|
||||||
SSH_AGENT_DIR="/tmp"
|
SSH_AGENT_DIR="/tmp"
|
||||||
|
|
||||||
if [ "$IS_ANDROID" == "true" ]; then
|
if [ "$IS_ANDROID" == "true" ]; then
|
||||||
|
|
@ -104,6 +103,16 @@ if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
|
||||||
source "$SSH_AGENT_DIR/ssh-agent.env" >/dev/null
|
source "$SSH_AGENT_DIR/ssh-agent.env" >/dev/null
|
||||||
fi
|
fi
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
But for now switched to the [[https://wiki.archlinux.org/title/SSH_keys#Start_ssh-agent_with_systemd_user][systemd unit]], which requires:
|
||||||
|
#+begin_src bash :tangle no
|
||||||
|
systemctl --user enable --now ssh-agent.service
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+begin_src bash
|
||||||
|
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** Misc settings
|
** Misc settings
|
||||||
Set Jupyter config PATH. I keep it from my Guix config where it defaulted to some readonly folder.
|
Set Jupyter config PATH. I keep it from my Guix config where it defaulted to some readonly folder.
|
||||||
#+begin_src sh
|
#+begin_src sh
|
||||||
|
|
@ -713,17 +722,15 @@ References:
|
||||||
- [[https://github.com/alacritty/alacritty/blob/master/alacritty.yml][default config]]
|
- [[https://github.com/alacritty/alacritty/blob/master/alacritty.yml][default config]]
|
||||||
|
|
||||||
#+begin_src toml :noweb yes
|
#+begin_src toml :noweb yes
|
||||||
decorations = "none"
|
|
||||||
|
|
||||||
[colors.bright]
|
[colors.bright]
|
||||||
Black = "<<get-color(name="light-black")>>"
|
black = "<<get-color(name="light-black")>>"
|
||||||
Red = "<<get-color(name="light-red")>>"
|
red = "<<get-color(name="light-red")>>"
|
||||||
Green = "<<get-color(name="light-green")>>"
|
green = "<<get-color(name="light-green")>>"
|
||||||
Yellow = "<<get-color(name="light-yellow")>>"
|
yellow = "<<get-color(name="light-yellow")>>"
|
||||||
Blue = "<<get-color(name="light-blue")>>"
|
blue = "<<get-color(name="light-blue")>>"
|
||||||
Magenta = "<<get-color(name="light-magenta")>>"
|
magenta = "<<get-color(name="light-magenta")>>"
|
||||||
Cyan = "<<get-color(name="light-cyan")>>"
|
cyan = "<<get-color(name="light-cyan")>>"
|
||||||
White = "<<get-color(name="light-white")>>"
|
white = "<<get-color(name="light-white")>>"
|
||||||
|
|
||||||
[colors.normal]
|
[colors.normal]
|
||||||
black = "<<get-color(name="black")>>"
|
black = "<<get-color(name="black")>>"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue