forked from jan-leila/nix-config
		
	updated nfs config
This commit is contained in:
		
							parent
							
								
									de6a43a239
								
							
						
					
					
						commit
						7c0c94b47a
					
				
					 2 changed files with 23 additions and 14 deletions
				
			
		|  | @ -15,7 +15,7 @@ in { | |||
|       export_directory = lib.mkOption { | ||||
|         type = lib.types.path; | ||||
|         description = "what are exports going to be stored in"; | ||||
|         default = "/exports"; | ||||
|         default = "/export"; | ||||
|       }; | ||||
|       directories = lib.mkOption { | ||||
|         type = lib.types.listOf (lib.types.submodule ({config, ...}: { | ||||
|  | @ -57,7 +57,7 @@ in { | |||
|       # create any folders that we need to have for our exports | ||||
|       systemd.tmpfiles.rules = | ||||
|         [ | ||||
|           "d ${config.host.network_storage.export_directory} 2775 root root -" | ||||
|           "d ${config.host.network_storage.export_directory} 2775 nobody nogroup -" | ||||
|         ] | ||||
|         ++ ( | ||||
|           builtins.map ( | ||||
|  | @ -77,14 +77,14 @@ in { | |||
|         ) | ||||
|       ); | ||||
|     } | ||||
|     (lib.mkIf config.host.impermanence.enable { | ||||
|       environment.persistence."/persist/system/root" = { | ||||
|         enable = true; | ||||
|         hideMounts = true; | ||||
|         directories = [ | ||||
|           config.host.network_storage.export_directory | ||||
|         ]; | ||||
|       }; | ||||
|     }) | ||||
|     # (lib.mkIf config.host.impermanence.enable { | ||||
|     #   environment.persistence."/persist/system/root" = { | ||||
|     #     enable = true; | ||||
|     #     hideMounts = true; | ||||
|     #     directories = [ | ||||
|     #       config.host.network_storage.export_directory | ||||
|     #     ]; | ||||
|     #   }; | ||||
|     # }) | ||||
|   ]); | ||||
| } | ||||
|  |  | |||
|  | @ -56,11 +56,20 @@ | |||
|               ++ ( | ||||
|                 lib.lists.imap0 ( | ||||
|                   i: directory: let | ||||
|                     option = fsid: "(rw,fsid=${toString fsid},nohide,insecure,no_subtree_check)"; | ||||
|                     addresses = ["100.64.0.0/10" "192.168.0.0/24" "127.0.0.1"]; | ||||
|                     createOptions = fsid: "(rw,fsid=${toString fsid},nohide,insecure,no_subtree_check)"; | ||||
|                     addresses = [ | ||||
|                       # loopback | ||||
|                       "127.0.0.1" | ||||
|                       "::1" | ||||
|                       # local network | ||||
|                       # "192.168.0.0/24" | ||||
|                       # tailscale | ||||
|                       "100.64.0.0/10" | ||||
|                       "fd7a:115c:a1e0::/48" | ||||
|                     ]; | ||||
|                     options = lib.strings.concatStrings ( | ||||
|                       lib.strings.intersperse " " ( | ||||
|                         lib.lists.imap0 (index: address: "${address}${option (1 + (i * (builtins.length addresses)) + index)}") addresses | ||||
|                         lib.lists.imap0 (index: address: "${address}${createOptions (1 + (i * (builtins.length addresses)) + index)}") addresses | ||||
|                       ) | ||||
|                     ); | ||||
|                   in "${directory._directory} ${options}" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue