forked from jan-leila/nix-config
		
	moved service config out of host namespace
This commit is contained in:
		
							parent
							
								
									c7938c3fe7
								
							
						
					
					
						commit
						597c25b49d
					
				
					 7 changed files with 98 additions and 125 deletions
				
			
		|  | @ -9,8 +9,7 @@ | |||
|   db_user = "forgejo"; | ||||
|   sshPort = 22222; | ||||
| in { | ||||
|   options.host.forgejo = { | ||||
|     enable = lib.mkEnableOption "should forgejo be enabled on this computer"; | ||||
|   options.services.forgejo = { | ||||
|     subdomain = lib.mkOption { | ||||
|       type = lib.types.str; | ||||
|       description = "subdomain of base domain that forgejo will be hosted at"; | ||||
|  | @ -18,10 +17,10 @@ in { | |||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   config = lib.mkIf config.host.forgejo.enable (lib.mkMerge [ | ||||
|   config = lib.mkIf config.services.forgejo.enable (lib.mkMerge [ | ||||
|     { | ||||
|       host = { | ||||
|         reverse_proxy.subdomains.${config.host.forgejo.subdomain} = { | ||||
|         reverse_proxy.subdomains.${config.services.forgejo.subdomain} = { | ||||
|           target = "http://localhost:${toString forgejoPort}"; | ||||
|         }; | ||||
|         postgres = { | ||||
|  | @ -34,32 +33,29 @@ in { | |||
|         }; | ||||
|       }; | ||||
| 
 | ||||
|       services = { | ||||
|         forgejo = { | ||||
|           enable = true; | ||||
|           database = { | ||||
|             type = "postgres"; | ||||
|             socket = "/run/postgresql"; | ||||
|       services.forgejo = { | ||||
|         database = { | ||||
|           type = "postgres"; | ||||
|           socket = "/run/postgresql"; | ||||
|         }; | ||||
|         lfs.enable = true; | ||||
|         settings = { | ||||
|           server = { | ||||
|             DOMAIN = "${config.services.forgejo.subdomain}.${config.host.reverse_proxy.hostname}"; | ||||
|             HTTP_PORT = forgejoPort; | ||||
|             START_SSH_SERVER = true; | ||||
|             SSH_LISTEN_PORT = sshPort; | ||||
|             SSH_PORT = 22; | ||||
|             BUILTIN_SSH_SERVER_USER = config.users.users.git.name; | ||||
|             ROOT_URL = "https://git.jan-leila.com"; | ||||
|           }; | ||||
|           lfs.enable = true; | ||||
|           settings = { | ||||
|             server = { | ||||
|               DOMAIN = "${config.host.forgejo.subdomain}.${config.host.reverse_proxy.hostname}"; | ||||
|               HTTP_PORT = forgejoPort; | ||||
|               START_SSH_SERVER = true; | ||||
|               SSH_LISTEN_PORT = sshPort; | ||||
|               SSH_PORT = 22; | ||||
|               BUILTIN_SSH_SERVER_USER = config.users.users.git.name; | ||||
|               ROOT_URL = "https://git.jan-leila.com"; | ||||
|             }; | ||||
|             service = { | ||||
|               DISABLE_REGISTRATION = true; | ||||
|             }; | ||||
|             database = { | ||||
|               DB_TYPE = "postgres"; | ||||
|               NAME = db_user; | ||||
|               USER = db_user; | ||||
|             }; | ||||
|           service = { | ||||
|             DISABLE_REGISTRATION = true; | ||||
|           }; | ||||
|           database = { | ||||
|             DB_TYPE = "postgres"; | ||||
|             NAME = db_user; | ||||
|             USER = db_user; | ||||
|           }; | ||||
|         }; | ||||
|       }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue