Start lorri with sytemd
Whenever possible, prefer starting things as systemd units instead of instantiating them in ~/.profile and other dotfiles.
This commit is contained in:
		
							parent
							
								
									048b7867bf
								
							
						
					
					
						commit
						938c1a4eb0
					
				
					 3 changed files with 24 additions and 5 deletions
				
			
		
							
								
								
									
										12
									
								
								configs/shared/.config/systemd/user/lorri.service
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								configs/shared/.config/systemd/user/lorri.service
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | ||||||
|  | [Unit] | ||||||
|  | ConditionUser=!@system | ||||||
|  | Description=Lorri build daemon | ||||||
|  | After=lorri.socket | ||||||
|  | Wants=lorri.socket | ||||||
|  | 
 | ||||||
|  | [Service] | ||||||
|  | ExecStart=%h/.nix-profile/bin/lorri daemon | ||||||
|  | PrivateTmp=true | ||||||
|  | ProtectSystem=strict | ||||||
|  | Restart=on-failure | ||||||
|  | WorkingDirectory=%h | ||||||
							
								
								
									
										9
									
								
								configs/shared/.config/systemd/user/lorri.socket
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								configs/shared/.config/systemd/user/lorri.socket
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | ||||||
|  | [Unit] | ||||||
|  | Description=Lorri build daemon | ||||||
|  | 
 | ||||||
|  | [Socket] | ||||||
|  | ListenStream=%t/lorri/daemon.socket | ||||||
|  | RuntimeDirectory=lorri | ||||||
|  | 
 | ||||||
|  | [Install] | ||||||
|  | WantedBy=sockets.target | ||||||
|  | @ -51,6 +51,9 @@ eval "$(ssh-agent -s)" | ||||||
| # TODO: Prefer `systemctl start docker.service` | # TODO: Prefer `systemctl start docker.service` | ||||||
| dockerd & | dockerd & | ||||||
| 
 | 
 | ||||||
|  | # Start lorri | ||||||
|  | systemctl --user start lorri.service | ||||||
|  | 
 | ||||||
| # Set environment variables for Nix. Don't run this for systems running NixOS. | # Set environment variables for Nix. Don't run this for systems running NixOS. | ||||||
| # TODO: Learn why I can't use the variables from ~/briefcase/.envrc. | # TODO: Learn why I can't use the variables from ~/briefcase/.envrc. | ||||||
| case $(hostname) in | case $(hostname) in | ||||||
|  | @ -58,8 +61,3 @@ case $(hostname) in | ||||||
|   seneca) . ~/.nix-profile/etc/profile.d/nix.sh;; |   seneca) . ~/.nix-profile/etc/profile.d/nix.sh;; | ||||||
|   wpcarro.c.googlers.com) . ~/.nix-profile/etc/profile.d/nix.sh;; |   wpcarro.c.googlers.com) . ~/.nix-profile/etc/profile.d/nix.sh;; | ||||||
| esac | esac | ||||||
| 
 |  | ||||||
| # NOTE: `lorri` needs to be below the calls to source Nix environment since it's |  | ||||||
| # installed with `nix-env -iA nixpkgs.lorri`. |  | ||||||
| # Start lorri daemon |  | ||||||
| lorri daemon & |  | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue