| 
									
										
										
										
											2025-05-29 16:34:24 +02:00
										 |  |  | { lib, config, ... }: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | with lib; | 
					
						
							|  |  |  | let | 
					
						
							|  |  |  |   cfg = config.modules.impermanence; | 
					
						
							|  |  |  | in | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   options.modules.impermanence = { | 
					
						
							|  |  |  |     enable = mkEnableOption "Impermanence"; | 
					
						
							|  |  |  |     directories = mkOption { | 
					
						
							|  |  |  |       type = types.listOf types.str; | 
					
						
							|  |  |  |       default = [ ]; | 
					
						
							|  |  |  |       description = ''
 | 
					
						
							|  |  |  |         Directories that should be stored in persistent storage. | 
					
						
							|  |  |  |       '';
 | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     files = mkOption { | 
					
						
							|  |  |  |       type = types.listOf types.str; | 
					
						
							|  |  |  |       default = [ ]; | 
					
						
							|  |  |  |       description = ''
 | 
					
						
							|  |  |  |         Files that should be stored in persistent storage. | 
					
						
							|  |  |  |       '';
 | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   config = mkIf cfg.enable { | 
					
						
							| 
									
										
										
										
											2025-05-29 17:05:15 +02:00
										 |  |  |     home.persistence."/persist/home/${config.home.username}" = { | 
					
						
							| 
									
										
										
										
											2025-05-29 16:34:24 +02:00
										 |  |  |       enable = true; | 
					
						
							|  |  |  |       hideMounts = true; | 
					
						
							| 
									
										
										
										
											2025-05-29 17:05:15 +02:00
										 |  |  |       allowOther = true; | 
					
						
							| 
									
										
										
										
											2025-05-29 16:34:24 +02:00
										 |  |  |       directories = cfg.directories; | 
					
						
							|  |  |  |       files = cfg.files; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | } |