forked from fediversity/fediversity
		
	Share options that can be shared
This commit is contained in:
		
							parent
							
								
									b547912794
								
							
						
					
					
						commit
						8c5bf79ba2
					
				
					 4 changed files with 71 additions and 92 deletions
				
			
		|  | @ -1,35 +1,14 @@ | |||
| { config, lib, ... }: | ||||
| 
 | ||||
| let | ||||
|   inherit (lib) mkOption mkEnableOption; | ||||
|   inherit (lib.types) types; | ||||
| 
 | ||||
| in | ||||
| { | ||||
|   options.fediversity.mastodon = { | ||||
|     enable = mkEnableOption "Enable a Mastodon server on the machine"; | ||||
|   options.fediversity.mastodon = | ||||
|     (import ../sharedOptions.nix { | ||||
|       inherit config lib; | ||||
|       serviceName = "mastodon"; | ||||
|       serviceDocName = "Mastodon"; | ||||
|     }) | ||||
|     // | ||||
| 
 | ||||
|     s3AccessKey = mkOption { | ||||
|       type = types.str; | ||||
|       description = '' | ||||
|         S3 access key | ||||
| 
 | ||||
|         In AWS CLI, this would be AWS_ACCESS_KEY_ID. | ||||
|       ''; | ||||
|     { | ||||
|     }; | ||||
| 
 | ||||
|     s3SecretKey = mkOption { | ||||
|       description = '' | ||||
|         S3 secret key | ||||
| 
 | ||||
|         In AWS CLI, this would be AWS_SECRET_ACCESS_KEY. | ||||
|       ''; | ||||
|     }; | ||||
| 
 | ||||
|     domain = mkOption { | ||||
|       type = types.str; | ||||
|       description = "Internal option — change at your own risk"; | ||||
|       default = "mastodon.${config.fediversity.domain}"; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
|  | @ -1,45 +1,28 @@ | |||
| { config, lib, ... }: | ||||
| 
 | ||||
| let | ||||
|   inherit (lib) mkOption mkEnableOption; | ||||
|   inherit (lib) mkOption; | ||||
|   inherit (lib.types) types; | ||||
| 
 | ||||
| in | ||||
| { | ||||
|   options.fediversity.peertube = { | ||||
|     enable = mkEnableOption "Enable a PeerTube server on the machine"; | ||||
|   options.fediversity.peertube = | ||||
|     (import ../sharedOptions.nix { | ||||
|       inherit config lib; | ||||
|       serviceName = "peertube"; | ||||
|       serviceDocName = "PeerTube"; | ||||
|     }) | ||||
|     // | ||||
| 
 | ||||
|     s3AccessKey = mkOption { | ||||
|       type = types.str; | ||||
|       description = '' | ||||
|         S3 access key | ||||
|     { | ||||
|       secretsFile = mkOption { | ||||
|         type = types.path; | ||||
|         description = '' | ||||
|           Internal option — change at your own risk | ||||
| 
 | ||||
|         In AWS CLI, this would be AWS_ACCESS_KEY_ID. | ||||
|       ''; | ||||
|           FIXME: should it be provided by NixOps4? | ||||
|           or maybe we should just ask for a main secret from which to derive all the others? | ||||
|         ''; | ||||
|       }; | ||||
|     }; | ||||
| 
 | ||||
|     s3SecretKey = mkOption { | ||||
|       description = '' | ||||
|         S3 secret key | ||||
| 
 | ||||
|         In AWS CLI, this would be AWS_SECRET_ACCESS_KEY. | ||||
|       ''; | ||||
|     }; | ||||
| 
 | ||||
|     domain = mkOption { | ||||
|       type = types.str; | ||||
|       description = "Internal option — change at your own risk"; | ||||
|       default = "peertube.${config.fediversity.domain}"; | ||||
|     }; | ||||
| 
 | ||||
|     secretsFile = mkOption { | ||||
|       type = types.path; | ||||
|       description = '' | ||||
|         Internal option — change at your own risk | ||||
| 
 | ||||
|         FIXME: should it be provided by NixOps4? | ||||
|         or maybe we should just ask for a main secret from which to derive all the others? | ||||
|       ''; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
|  | @ -1,35 +1,14 @@ | |||
| { config, lib, ... }: | ||||
| 
 | ||||
| let | ||||
|   inherit (lib) mkOption mkEnableOption; | ||||
|   inherit (lib.types) types; | ||||
| 
 | ||||
| in | ||||
| { | ||||
|   options.fediversity.pixelfed = { | ||||
|     enable = mkEnableOption "Enable a Pixelfed server on the machine"; | ||||
|   options.fediversity.pixelfed = | ||||
|     (import ../sharedOptions.nix { | ||||
|       inherit config lib; | ||||
|       serviceName = "pixelfed"; | ||||
|       serviceDocName = "Pixelfed"; | ||||
|     }) | ||||
|     // | ||||
| 
 | ||||
|     s3AccessKey = mkOption { | ||||
|       type = types.str; | ||||
|       description = '' | ||||
|         S3 access key | ||||
| 
 | ||||
|         In AWS CLI, this would be AWS_ACCESS_KEY_ID. | ||||
|       ''; | ||||
|     { | ||||
|     }; | ||||
| 
 | ||||
|     s3SecretKey = mkOption { | ||||
|       description = '' | ||||
|         S3 secret key | ||||
| 
 | ||||
|         In AWS CLI, this would be AWS_SECRET_ACCESS_KEY. | ||||
|       ''; | ||||
|     }; | ||||
| 
 | ||||
|     domain = mkOption { | ||||
|       type = types.str; | ||||
|       description = "Internal option — change at your own risk"; | ||||
|       default = "pixelfed.${config.fediversity.domain}"; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  |  | |||
							
								
								
									
										38
									
								
								services/fediversity/sharedOptions.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								services/fediversity/sharedOptions.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,38 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   serviceName, | ||||
|   serviceDocName, | ||||
| }: | ||||
| 
 | ||||
| let | ||||
|   inherit (lib) mkOption mkEnableOption; | ||||
|   inherit (lib.types) types; | ||||
| 
 | ||||
| in | ||||
| { | ||||
|   enable = mkEnableOption "Enable a ${serviceDocName} server on the machine"; | ||||
| 
 | ||||
|   s3AccessKey = mkOption { | ||||
|     type = types.str; | ||||
|     description = '' | ||||
|       S3 access key for ${serviceDocName}'s bucket/s | ||||
| 
 | ||||
|       In AWS CLI, this would be AWS_ACCESS_KEY_ID. | ||||
|     ''; | ||||
|   }; | ||||
| 
 | ||||
|   s3SecretKey = mkOption { | ||||
|     description = '' | ||||
|       S3 secret key for ${serviceDocName}'s bucket/s | ||||
| 
 | ||||
|       In AWS CLI, this would be AWS_SECRET_ACCESS_KEY. | ||||
|     ''; | ||||
|   }; | ||||
| 
 | ||||
|   domain = mkOption { | ||||
|     type = types.str; | ||||
|     description = "Internal option — change at your own risk"; | ||||
|     default = "${serviceName}.${config.fediversity.domain}"; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		
		Reference in a new issue