···7 meta.maintainers = lib.teams.home-assistant.members;
89 nodes.hass = { pkgs, ... }: {
10- environment.systemPackages = with pkgs; [ mosquitto ];
11-12 services.postgresql = {
13 enable = true;
14 ensureDatabases = [ "hass" ];
···108 # Cause a configuration change that requires a service restart as we added a new runtime dependency
109 specialisation.newFeature = {
110 inheritParentConfig = true;
111- configuration.services.home-assistant.config.device_tracker = [
112- { platform = "bluetooth_tracker"; }
113- ];
114 };
115 };
116···119 in
120 ''
121 import re
0122123 start_all()
124···131 assert match
132 package = match.group('path')
13300000000000134 hass.wait_for_unit("home-assistant.service")
0135136 with subtest("Check that YAML configuration file is in place"):
137 hass.succeed("test -L ${configDir}/configuration.yaml")
···148 hass.succeed(f"grep -q 'wake_on_lan' {package}/extra_components")
149150 with subtest("Check that Home Assistant's web interface and API can be reached"):
151- hass.wait_until_succeeds("journalctl -u home-assistant.service | grep -q 'Home Assistant initialized in'")
152 hass.wait_for_open_port(8123)
153 hass.succeed("curl --fail http://localhost:8123/lovelace")
154···162 with subtest("Check service reloads when configuration changes"):
163 # store the old pid of the process
164 pid = hass.succeed("systemctl show --property=MainPID home-assistant.service")
0165 hass.succeed("${system}/specialisation/differentName/bin/switch-to-configuration test")
166 new_pid = hass.succeed("systemctl show --property=MainPID home-assistant.service")
167 assert pid == new_pid, "The PID of the process should not change between process reloads"
0168169 with subtest("check service restarts when package changes"):
170 pid = new_pid
0171 hass.succeed("${system}/specialisation/newFeature/bin/switch-to-configuration test")
172 new_pid = hass.succeed("systemctl show --property=MainPID home-assistant.service")
173 assert pid != new_pid, "The PID of the process shoudl change when the HA binary changes"
0174175 with subtest("Check that no errors were logged"):
176 output_log = hass.succeed("cat ${configDir}/home-assistant.log")
···7 meta.maintainers = lib.teams.home-assistant.members;
89 nodes.hass = { pkgs, ... }: {
0010 services.postgresql = {
11 enable = true;
12 ensureDatabases = [ "hass" ];
···106 # Cause a configuration change that requires a service restart as we added a new runtime dependency
107 specialisation.newFeature = {
108 inheritParentConfig = true;
109+ configuration.services.home-assistant.config.esphome = {};
00110 };
111 };
112···115 in
116 ''
117 import re
118+ import json
119120 start_all()
121···128 assert match
129 package = match.group('path')
130131+132+ def get_journal_cursor(host) -> str:
133+ exit, out = host.execute("journalctl -u home-assistant.service -n1 -o json-pretty --output-fields=__CURSOR")
134+ assert exit == 0
135+ return json.loads(out)["__CURSOR"]
136+137+138+ def wait_for_homeassistant(host, cursor):
139+ host.wait_until_succeeds(f"journalctl --after-cursor='{cursor}' -u home-assistant.service | grep -q 'Home Assistant initialized in'")
140+141+142 hass.wait_for_unit("home-assistant.service")
143+ cursor = get_journal_cursor(hass)
144145 with subtest("Check that YAML configuration file is in place"):
146 hass.succeed("test -L ${configDir}/configuration.yaml")
···157 hass.succeed(f"grep -q 'wake_on_lan' {package}/extra_components")
158159 with subtest("Check that Home Assistant's web interface and API can be reached"):
160+ wait_for_homeassistant(hass, cursor)
161 hass.wait_for_open_port(8123)
162 hass.succeed("curl --fail http://localhost:8123/lovelace")
163···171 with subtest("Check service reloads when configuration changes"):
172 # store the old pid of the process
173 pid = hass.succeed("systemctl show --property=MainPID home-assistant.service")
174+ cursor = get_journal_cursor(hass)
175 hass.succeed("${system}/specialisation/differentName/bin/switch-to-configuration test")
176 new_pid = hass.succeed("systemctl show --property=MainPID home-assistant.service")
177 assert pid == new_pid, "The PID of the process should not change between process reloads"
178+ wait_for_homeassistant(hass, cursor)
179180 with subtest("check service restarts when package changes"):
181 pid = new_pid
182+ cursor = get_journal_cursor(hass)
183 hass.succeed("${system}/specialisation/newFeature/bin/switch-to-configuration test")
184 new_pid = hass.succeed("systemctl show --property=MainPID home-assistant.service")
185 assert pid != new_pid, "The PID of the process shoudl change when the HA binary changes"
186+ wait_for_homeassistant(hass, cursor)
187188 with subtest("Check that no errors were logged"):
189 output_log = hass.succeed("cat ${configDir}/home-assistant.log")
···910stdenv.mkDerivation rec {
11 pname = "signal-desktop";
12- version = "5.49.0"; # Please backport all updates to the stable channel.
13 # All releases have a limited lifetime and "expire" 90 days after the release.
14 # When releases "expire" the application becomes unusable until an update is
15 # applied. The expiration date for the current release can be extracted with:
···1920 src = fetchurl {
21 url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
22- sha256 = "sha256-rrDUaFcqslSuJwTYx1exEfvuHKKnPZKh+RYerOcKGG0=";
23 };
2425 nativeBuildInputs = [
···910stdenv.mkDerivation rec {
11 pname = "signal-desktop";
12+ version = "5.50.0"; # Please backport all updates to the stable channel.
13 # All releases have a limited lifetime and "expire" 90 days after the release.
14 # When releases "expire" the application becomes unusable until an update is
15 # applied. The expiration date for the current release can be extracted with:
···1920 src = fetchurl {
21 url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
22+ sha256 = "sha256-3/a0+FTRSI7MdI/4mAhKl/KEBoEM1rqTUUWTpNFJTSA=";
23 };
2425 nativeBuildInputs = [