New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/home-assistant: change systemd network target #120309
Conversation
Many Home Assistant integrations pull in information from websites at early stages and therefore need a fully set-up network config.
Do they refetch that information after network is available? Using network-online is not great as it delays the startup unnecessary. |
Home-assistant components are usually pretty resilient. What concrete issues do you have that are going to be fixed by this change? |
If this is a special case rather than the norm it is also fine to do:
in your own NixOS configuration. But it is better to fix the underlying issue because having no network is an expected network condition and hence connectivity cannot be relied on for a system not too fail |
One integration that had some problems is met.no. If it can't fetch the weather data at startup, there are some error messages saying that the configuration is incorrect and no weather data is available for a couple of minutes. This might lead to some problems if automation is depending on the weather, and I think met.no is even part of the default configuration of Home Assistant. This is certainly not a special case. However, I've also figured that there might be a scenario where one doesn't want their Home Assistant server to have any connection to any network whatsoever. In this case, starting Home Assistant after Adding the target manually is an option and also what I'm doing right now, but it is rather hacky to NixOS standards; Newcomers will probably miss this. So, may I suggest adding an option to wait for |
Home Assistant's From my point of the startup should be as fast as possible as you want to be able to control your devices. But use cases are different 😉 |
It sounds like the conclusion is that we don't want to move forwards with the change in this form.
This doesn't sound like the worst idea in the world, but that's up to the HA module maintainers. |
On my raspberry pi 4 the difference between Personally, I think this is what overwrites are for. Maybe add yours and your use case to the wiki?
I disagree, this is pretty common when your setup becomes opinionated.
Not really a fan, given that is so easy to override. |
Given the arguments, I'll withdraw this PR. |
Motivation for this change
Many Home Assistant integrations pull in information from websites at early stages and therefore need a fully set-up network when they start. If Home Assistant is starts directly after
network.target
, a connection to the internet might not be established, but it (probably) is afternetwork-online.target
. More info: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)