forked from jan-leila/nix-config
		
	removed postgres from home-assistant db
This commit is contained in:
		
							parent
							
								
									5964554060
								
							
						
					
					
						commit
						3cd17b3693
					
				
					 2 changed files with 19 additions and 65 deletions
				
			
		|  | @ -1,11 +1,9 @@ | |||
| { | ||||
|   lib, | ||||
|   pkgs, | ||||
|   config, | ||||
|   ... | ||||
| }: let | ||||
|   configDir = "/var/lib/hass"; | ||||
|   db_user = "hass"; | ||||
| in { | ||||
|   options.host.home-assistant = { | ||||
|     enable = lib.mkEnableOption "should home-assistant be enabled on this computer"; | ||||
|  | @ -23,13 +21,6 @@ in { | |||
|       ]; | ||||
|       services.home-assistant = { | ||||
|         enable = true; | ||||
|         package = | ||||
|           (pkgs.home-assistant.override { | ||||
|             extraPackages = py: with py; [psycopg2]; | ||||
|           }) | ||||
|           .overrideAttrs (oldAttrs: { | ||||
|             doInstallCheck = false; | ||||
|           }); | ||||
|         configDir = configDir; | ||||
|         extraComponents = [ | ||||
|           "met" | ||||
|  | @ -43,7 +34,6 @@ in { | |||
|           "sonos" | ||||
|           "analytics_insights" | ||||
|           "unifi" | ||||
|           "minecraft_server" | ||||
|           "openweathermap" | ||||
|         ]; | ||||
|         config = { | ||||
|  | @ -54,7 +44,7 @@ in { | |||
|             ip_ban_enabled = true; | ||||
|             login_attempts_threshold = 10; | ||||
|           }; | ||||
|           recorder.db_url = "postgresql://@/${db_user}"; | ||||
|           # recorder.db_url = "postgresql://@/${db_user}"; | ||||
|           "automation manual" = []; | ||||
|           "automation ui" = "!include automations.yaml"; | ||||
|         }; | ||||
|  | @ -65,11 +55,6 @@ in { | |||
|             gtts | ||||
|           ]; | ||||
|       }; | ||||
|       systemd.services.home-assistant = { | ||||
|         requires = [ | ||||
|           "postgresql.service" | ||||
|         ]; | ||||
|       }; | ||||
|       host = { | ||||
|         reverse_proxy.subdomains.${config.host.home-assistant.subdomain} = { | ||||
|           target = "http://localhost:${toString config.services.home-assistant.config.http.server_port}"; | ||||
|  | @ -90,20 +75,6 @@ in { | |||
|             proxy_read_timeout 90; | ||||
|           ''; | ||||
|         }; | ||||
|         postgres = { | ||||
|           enable = true; | ||||
|           extraUsers = { | ||||
|             ${db_user} = { | ||||
|               isClient = true; | ||||
|               createUser = true; | ||||
|             }; | ||||
|           }; | ||||
|           extraDatabases = { | ||||
|             ${db_user} = { | ||||
|               name = db_user; | ||||
|             }; | ||||
|           }; | ||||
|         }; | ||||
|       }; | ||||
|     } | ||||
|     (lib.mkIf config.host.impermanence.enable { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue