Configure secrets, configure ssh and add H4G0
This commit is contained in:
		
							parent
							
								
									fdc052d82c
								
							
						
					
					
						commit
						21fa5a8411
					
				
					 8 changed files with 124 additions and 7 deletions
				
			
		|  | @ -18,7 +18,11 @@ | |||
|   users.users.tdpeuter = { | ||||
|     description = "Tibo De Peuter"; | ||||
|     isNormalUser = true; | ||||
|     extraGroups = [ "networkmanager" "wheel" ]; | ||||
|     extraGroups = [  | ||||
|       config.users.groups.keys.name | ||||
|       config.users.groups.networkmanager.name | ||||
|       config.users.groups.wheel.name | ||||
|     ]; | ||||
|     initialPassword = "ChangeMe"; | ||||
|     packages = with pkgs; [ | ||||
|       home-manager | ||||
|  |  | |||
|  | @ -1,6 +1,8 @@ | |||
| { | ||||
|   imports = [ | ||||
|     ./mpv | ||||
|     ./sops | ||||
|     ./ssh | ||||
|     ./vifm | ||||
|     ./vim | ||||
|     ./zellij | ||||
|  |  | |||
							
								
								
									
										27
									
								
								nixos/modules/utils/sops/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								nixos/modules/utils/sops/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,27 @@ | |||
| { config, lib, pkgs, ... }: | ||||
| 
 | ||||
| { | ||||
|   environment.systemPackages = with pkgs; [ | ||||
|     sops | ||||
|   ]; | ||||
| 
 | ||||
|   sops = { | ||||
|     # Add secrets.yml to the nix store | ||||
|     defaultSopsFile = ../../../secrets/secrets.yaml; | ||||
|     age = { | ||||
|       # Automatically import SSH keys as age keys | ||||
|       sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; | ||||
|       # Use an age key that is expected to already be in the filesystem | ||||
|       keyFile = "/var/lib/sops-nix/key.txt"; | ||||
|       # Generate new keys if the key specified above does not exist | ||||
|       generateKey = true; | ||||
|     }; | ||||
|     secrets = { | ||||
|       "H4G0/ssh" = { | ||||
|         format = "yaml"; | ||||
|         sopsFile = ../../../secrets/H4G0.yaml; | ||||
|         owner = config.users.users.tdpeuter.name; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  | @ -5,4 +5,18 @@ | |||
|     enable = true; | ||||
|     passwordAuthentication = false; | ||||
|   }; | ||||
| 
 | ||||
|   home-manager.users.tdpeuter = { | ||||
|     programs.ssh = { | ||||
|       enable = true; | ||||
|       matchBlocks = { | ||||
|         "H4G0" = { | ||||
|           hostname = "192.168.0.11"; | ||||
|           identitiesOnly = true; | ||||
|           identityFile = "/run/secrets/H4G0/ssh"; | ||||
|           user = "admin"; | ||||
|         }; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue