mirror of
				https://github.com/shokinn/.files.git
				synced 2025-11-04 04:28:11 +00:00 
			
		
		
		
	Add Systemd service for ssh-agent; end SSH_AGENT environment variable.
This commit is contained in:
		
							parent
							
								
									14f6e22294
								
							
						
					
					
						commit
						aa36dbf190
					
				
					 3 changed files with 30 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -36,6 +36,9 @@ dotfiles:
 | 
			
		|||
  f_profile:
 | 
			
		||||
    dst: ~/.profile
 | 
			
		||||
    src: profile
 | 
			
		||||
  f_ssh-agent.service:
 | 
			
		||||
    dst: ~/.config/systemd/user/ssh-agent.service
 | 
			
		||||
    src: config/systemd/user/ssh-agent.service
 | 
			
		||||
  f_vimrc:
 | 
			
		||||
    dst: ~/.vimrc
 | 
			
		||||
    src: vimrc
 | 
			
		||||
| 
						 | 
				
			
			@ -69,3 +72,4 @@ profiles:
 | 
			
		|||
    - f_powerlevel9krc
 | 
			
		||||
    - d_colors
 | 
			
		||||
    - f_xresources
 | 
			
		||||
    - f_ssh-agent.service
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										20
									
								
								dotfiles/config/systemd/user/ssh-agent.service
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								dotfiles/config/systemd/user/ssh-agent.service
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,20 @@
 | 
			
		|||
#
 | 
			
		||||
# {{@@ env['dotdrop_warning'] @@}}
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=SSH key agent
 | 
			
		||||
Wants=environment.target
 | 
			
		||||
Before=environment.target
 | 
			
		||||
IgnoreOnIsolate=true
 | 
			
		||||
 | 
			
		||||
[Service]
 | 
			
		||||
Type=forking
 | 
			
		||||
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
 | 
			
		||||
ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK
 | 
			
		||||
ExecStartPost=/usr/bin/systemctl --user set-environment SSH_AUTH_SOCK=${SSH_AUTH_SOCK}
 | 
			
		||||
#ExecStop=/usr/bin/ssh-agent -k
 | 
			
		||||
ExecStopPost=/bin/rm ${SSH_AUTH_SOCK}
 | 
			
		||||
 | 
			
		||||
[Install]
 | 
			
		||||
WantedBy=default.target
 | 
			
		||||
| 
						 | 
				
			
			@ -2,9 +2,15 @@
 | 
			
		|||
# {{@@ env['dotdrop_warning'] @@}}
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# Set XDG_CONFIG_HOME
 | 
			
		||||
XDG_CONFIG_HOME="$HOME/.config"
 | 
			
		||||
export XDG_CONFIG_HOME
 | 
			
		||||
# SSH Agent (KeeAgent)
 | 
			
		||||
SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
 | 
			
		||||
export SSH_AUTH_SOCK
 | 
			
		||||
# Use vim as editor on X
 | 
			
		||||
VISUAL='vim'
 | 
			
		||||
export VISUAL
 | 
			
		||||
# Use vim as standard editor
 | 
			
		||||
EDITOR='vim'
 | 
			
		||||
export EDITOR
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue