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
				
			
		
							
								
								
									
										53
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										53
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							|  | @ -29,11 +29,11 @@ | ||||||
|       }, |       }, | ||||||
|       "locked": { |       "locked": { | ||||||
|         "dir": "pkgs/firefox-addons", |         "dir": "pkgs/firefox-addons", | ||||||
|         "lastModified": 1741233805, |         "lastModified": 1741665811, | ||||||
|         "narHash": "sha256-aNmlbxeKPUfuOynHvIMBPrNgEs1ldHDIz1wbkitKDSs=", |         "narHash": "sha256-yQwFid0LSC2syNBTXCSJTZ1EX1OQjBoGk0fSIaaiC+Q=", | ||||||
|         "owner": "rycee", |         "owner": "rycee", | ||||||
|         "repo": "nur-expressions", |         "repo": "nur-expressions", | ||||||
|         "rev": "a1cc22e90f45f6075a991348e896f1595c4efce9", |         "rev": "ba7a019fc6c9ee63e3e1a425e0bbf8dd697f7b16", | ||||||
|         "type": "gitlab" |         "type": "gitlab" | ||||||
|       }, |       }, | ||||||
|       "original": { |       "original": { | ||||||
|  | @ -58,22 +58,6 @@ | ||||||
|         "type": "github" |         "type": "github" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "flake-compat_2": { |  | ||||||
|       "flake": false, |  | ||||||
|       "locked": { |  | ||||||
|         "lastModified": 1696426674, |  | ||||||
|         "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", |  | ||||||
|         "owner": "edolstra", |  | ||||||
|         "repo": "flake-compat", |  | ||||||
|         "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", |  | ||||||
|         "type": "github" |  | ||||||
|       }, |  | ||||||
|       "original": { |  | ||||||
|         "owner": "edolstra", |  | ||||||
|         "repo": "flake-compat", |  | ||||||
|         "type": "github" |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     "flake-utils": { |     "flake-utils": { | ||||||
|       "locked": { |       "locked": { | ||||||
|         "lastModified": 1629284811, |         "lastModified": 1629284811, | ||||||
|  | @ -147,11 +131,11 @@ | ||||||
|         ] |         ] | ||||||
|       }, |       }, | ||||||
|       "locked": { |       "locked": { | ||||||
|         "lastModified": 1741217763, |         "lastModified": 1741635347, | ||||||
|         "narHash": "sha256-g/TrltIjFHIjtzKY5CJpoPANfHQWDD43G5U1a/v5oVg=", |         "narHash": "sha256-2aYfV44h18alHXopyfL4D9GsnpE5XlSVkp4MGe586VU=", | ||||||
|         "owner": "nix-community", |         "owner": "nix-community", | ||||||
|         "repo": "home-manager", |         "repo": "home-manager", | ||||||
|         "rev": "486b066025dccd8af7fbe5dd2cc79e46b88c80da", |         "rev": "7fb8678716c158642ac42f9ff7a18c0800fea551", | ||||||
|         "type": "github" |         "type": "github" | ||||||
|       }, |       }, | ||||||
|       "original": { |       "original": { | ||||||
|  | @ -232,18 +216,17 @@ | ||||||
|     }, |     }, | ||||||
|     "nix-vscode-extensions": { |     "nix-vscode-extensions": { | ||||||
|       "inputs": { |       "inputs": { | ||||||
|         "flake-compat": "flake-compat_2", |  | ||||||
|         "flake-utils": "flake-utils_3", |         "flake-utils": "flake-utils_3", | ||||||
|         "nixpkgs": [ |         "nixpkgs": [ | ||||||
|           "nixpkgs" |           "nixpkgs" | ||||||
|         ] |         ] | ||||||
|       }, |       }, | ||||||
|       "locked": { |       "locked": { | ||||||
|         "lastModified": 1740275623, |         "lastModified": 1741657825, | ||||||
|         "narHash": "sha256-LQ9hq3hKwWqm+dzBhgsIkr2KO6Bb0aU+yO/TtI7hXXo=", |         "narHash": "sha256-QzO/VwD7OAedSFpDuj7XCQSpiGEy597nrQNii5wPW5Q=", | ||||||
|         "owner": "nix-community", |         "owner": "nix-community", | ||||||
|         "repo": "nix-vscode-extensions", |         "repo": "nix-vscode-extensions", | ||||||
|         "rev": "35ff5dce04469e7b4e56a9d997e5201bfce52ae3", |         "rev": "c87cf45f4901c86a62fae357a06a6ad84af2a496", | ||||||
|         "type": "github" |         "type": "github" | ||||||
|       }, |       }, | ||||||
|       "original": { |       "original": { | ||||||
|  | @ -254,11 +237,11 @@ | ||||||
|     }, |     }, | ||||||
|     "nixos-hardware": { |     "nixos-hardware": { | ||||||
|       "locked": { |       "locked": { | ||||||
|         "lastModified": 1740646007, |         "lastModified": 1741325094, | ||||||
|         "narHash": "sha256-dMReDQobS3kqoiUCQIYI9c0imPXRZnBubX20yX/G5LE=", |         "narHash": "sha256-RUAdT8dZ6k/486vnu3tiNRrNW6+Q8uSD2Mq7gTX4jlo=", | ||||||
|         "owner": "NixOS", |         "owner": "NixOS", | ||||||
|         "repo": "nixos-hardware", |         "repo": "nixos-hardware", | ||||||
|         "rev": "009b764ac98a3602d41fc68072eeec5d24fc0e49", |         "rev": "b48cc4dab0f9711af296fc367b6108cf7b8ccb16", | ||||||
|         "type": "github" |         "type": "github" | ||||||
|       }, |       }, | ||||||
|       "original": { |       "original": { | ||||||
|  | @ -270,11 +253,11 @@ | ||||||
|     }, |     }, | ||||||
|     "nixpkgs": { |     "nixpkgs": { | ||||||
|       "locked": { |       "locked": { | ||||||
|         "lastModified": 1741173522, |         "lastModified": 1741513245, | ||||||
|         "narHash": "sha256-k7VSqvv0r1r53nUI/IfPHCppkUAddeXn843YlAC5DR0=", |         "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", | ||||||
|         "owner": "nixos", |         "owner": "nixos", | ||||||
|         "repo": "nixpkgs", |         "repo": "nixpkgs", | ||||||
|         "rev": "d69ab0d71b22fa1ce3dbeff666e6deb4917db049", |         "rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1", | ||||||
|         "type": "github" |         "type": "github" | ||||||
|       }, |       }, | ||||||
|       "original": { |       "original": { | ||||||
|  | @ -323,11 +306,11 @@ | ||||||
|         ] |         ] | ||||||
|       }, |       }, | ||||||
|       "locked": { |       "locked": { | ||||||
|         "lastModified": 1741043164, |         "lastModified": 1741644481, | ||||||
|         "narHash": "sha256-9lfmSZLz6eq9Ygr6cCmvQiiBEaPb54pUBcjvbEMPORc=", |         "narHash": "sha256-E0RrMykMtEv15V3QhpsFutgoSKhL1JBhidn+iZajOyg=", | ||||||
|         "owner": "Mic92", |         "owner": "Mic92", | ||||||
|         "repo": "sops-nix", |         "repo": "sops-nix", | ||||||
|         "rev": "3f2412536eeece783f0d0ad3861417f347219f4d", |         "rev": "e653d71e82575a43fe9d228def8eddb73887b866", | ||||||
|         "type": "github" |         "type": "github" | ||||||
|       }, |       }, | ||||||
|       "original": { |       "original": { | ||||||
|  |  | ||||||
|  | @ -1,11 +1,9 @@ | ||||||
| { | { | ||||||
|   lib, |   lib, | ||||||
|   pkgs, |  | ||||||
|   config, |   config, | ||||||
|   ... |   ... | ||||||
| }: let | }: let | ||||||
|   configDir = "/var/lib/hass"; |   configDir = "/var/lib/hass"; | ||||||
|   db_user = "hass"; |  | ||||||
| in { | in { | ||||||
|   options.host.home-assistant = { |   options.host.home-assistant = { | ||||||
|     enable = lib.mkEnableOption "should home-assistant be enabled on this computer"; |     enable = lib.mkEnableOption "should home-assistant be enabled on this computer"; | ||||||
|  | @ -23,13 +21,6 @@ in { | ||||||
|       ]; |       ]; | ||||||
|       services.home-assistant = { |       services.home-assistant = { | ||||||
|         enable = true; |         enable = true; | ||||||
|         package = |  | ||||||
|           (pkgs.home-assistant.override { |  | ||||||
|             extraPackages = py: with py; [psycopg2]; |  | ||||||
|           }) |  | ||||||
|           .overrideAttrs (oldAttrs: { |  | ||||||
|             doInstallCheck = false; |  | ||||||
|           }); |  | ||||||
|         configDir = configDir; |         configDir = configDir; | ||||||
|         extraComponents = [ |         extraComponents = [ | ||||||
|           "met" |           "met" | ||||||
|  | @ -43,7 +34,6 @@ in { | ||||||
|           "sonos" |           "sonos" | ||||||
|           "analytics_insights" |           "analytics_insights" | ||||||
|           "unifi" |           "unifi" | ||||||
|           "minecraft_server" |  | ||||||
|           "openweathermap" |           "openweathermap" | ||||||
|         ]; |         ]; | ||||||
|         config = { |         config = { | ||||||
|  | @ -54,7 +44,7 @@ in { | ||||||
|             ip_ban_enabled = true; |             ip_ban_enabled = true; | ||||||
|             login_attempts_threshold = 10; |             login_attempts_threshold = 10; | ||||||
|           }; |           }; | ||||||
|           recorder.db_url = "postgresql://@/${db_user}"; |           # recorder.db_url = "postgresql://@/${db_user}"; | ||||||
|           "automation manual" = []; |           "automation manual" = []; | ||||||
|           "automation ui" = "!include automations.yaml"; |           "automation ui" = "!include automations.yaml"; | ||||||
|         }; |         }; | ||||||
|  | @ -65,11 +55,6 @@ in { | ||||||
|             gtts |             gtts | ||||||
|           ]; |           ]; | ||||||
|       }; |       }; | ||||||
|       systemd.services.home-assistant = { |  | ||||||
|         requires = [ |  | ||||||
|           "postgresql.service" |  | ||||||
|         ]; |  | ||||||
|       }; |  | ||||||
|       host = { |       host = { | ||||||
|         reverse_proxy.subdomains.${config.host.home-assistant.subdomain} = { |         reverse_proxy.subdomains.${config.host.home-assistant.subdomain} = { | ||||||
|           target = "http://localhost:${toString config.services.home-assistant.config.http.server_port}"; |           target = "http://localhost:${toString config.services.home-assistant.config.http.server_port}"; | ||||||
|  | @ -90,20 +75,6 @@ in { | ||||||
|             proxy_read_timeout 90; |             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 { |     (lib.mkIf config.host.impermanence.enable { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue