Added service to set up user keytab
This commit is contained in:
		
							parent
							
								
									32e7d99292
								
							
						
					
					
						commit
						d4e6283c2f
					
				| @ -19,11 +19,6 @@ | |||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   # Setup NAS backups |   # Setup NAS backups | ||||||
|   environment.systemPackages = with pkgs; [ |  | ||||||
|     cifs-utils |  | ||||||
|     samba |  | ||||||
|     keyutils |  | ||||||
|   ]; |  | ||||||
|   environment.etc."request-key.conf".text = |   environment.etc."request-key.conf".text = | ||||||
|     let |     let | ||||||
|       upcall = "${pkgs.cifs-utils}/bin/cifs.upcall"; |       upcall = "${pkgs.cifs-utils}/bin/cifs.upcall"; | ||||||
| @ -47,6 +42,16 @@ | |||||||
|   sops.secrets."smb-credentials" = { |   sops.secrets."smb-credentials" = { | ||||||
|     sopsFile = "${inputs.secrets}/secrets/vm-oddjob.enc.yaml"; |     sopsFile = "${inputs.secrets}/secrets/vm-oddjob.enc.yaml"; | ||||||
|   }; |   }; | ||||||
|  |   systemd.services.mnt-nas-krb5 = { | ||||||
|  |     description = "Set up Kerberos credentials for mnt-nas"; | ||||||
|  |     before = [ "mnt-nas.mount" ]; | ||||||
|  |     requiredBy = [ "mnt-nas.mount" ]; | ||||||
|  |     serviceConfig.type = "oneshot"; | ||||||
|  |     script = '' | ||||||
|  |       . ${config.sops.secrets."smb-credentials".path} | ||||||
|  |       echo $password | kinit $username | ||||||
|  |     ''; | ||||||
|  |   }; | ||||||
|   fileSystems."/mnt/nas" = { |   fileSystems."/mnt/nas" = { | ||||||
|     device = "//${inputs.secrets.lab.nas.host}/Backup"; |     device = "//${inputs.secrets.lab.nas.host}/Backup"; | ||||||
|     fsType = "cifs"; |     fsType = "cifs"; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jan-Bulthuis
						Jan-Bulthuis