I installed Home Assistant with the nix module. Is this fine?

I’m on Nixpkgs unstable and I copied the config from the nixos wiki: https://wiki.nixos.org/wiki/Home_Assistant. I just started trying home assistant.

      services.home-assistant = {
        enable = true;
        extraComponents = [
          # Components required to complete the onboarding
          "analytics"
          "google_translate"
          "met"
          "radio_browser"
          "shopping_list"
          # Recommended for fast zlib compression
          # https://www.home-assistant.io/integrations/isal
          "isal"
        ];
        config = {
          # Includes dependencies for a basic setup
          # https://www.home-assistant.io/integrations/default_config/
          default_config = { };
        };
      };

Core just means “installing directly into a python environment”, which is the way you kind of need to do it for proper Nix packaging. The only 2 supported methods now are HA OS and the container. It should be fine. Also one of the core HA developers is very hostile to Nix and has no clue how FOSS or Nix work:

Also, the decision to stop supporting Core was based on opt-in analytics, which is a horrible way of telling who is using advanced features (as most people using advanced features will not enable analytics, and will opt out if it is enabled by default): Deprecating Core and Supervised installation methods, and 32-bit systems - Home Assistant

If you really want you can run it in a container as a Quadlet with GitHub - mirkolenz/quadlet-nix: NixOS module for Quadlet / podman-systemd · GitHub, which is closer to the upstream path.

2 Likes

We, the nixpkgs home-assistant maintainers, think it’s going to work out. The support situation isn’t changing, they don’t want our issues, unless they are reproducible on officially supported setups.

Your first point of contact is #homeautomation:nixos.org or the nixpkgs issue tracker. We’ll keep supporting home-assistant on nixpkgs as long as we can, and we’ll likely patch this warning out.

6 Likes

For what it’s worth my experience with Home Assistant in NixOS has been good. I switched from docker in 2022 and haven’t looked back.

There was a learning curve for handling missing modules (home assistant installed modules on the fly last time I used the officially supported method), but that was easy enough to resolve following the wiki page.

The benefits of Home Assistant in NixOS for me was:

  • A better security disposition (in my opinion, others may disagree) than a docker container
  • Ability to write functions for my home-assistant config in nix expressions, replacing verbose YAML
  • Better hackability (and maintainability of my hacks) with the use of nix overlays

The drawbacks are things that “just work” with an officially support method may take some debug and know how to work on NixOS.

3 Likes

This — along with HA’s resource footprint (being Python¹) and its overly complex UX architecture — made me look into open source home automation alternatives a while ago, but unfortunately it seems it really is the only real choice. Has anyone found anything else worth looking into?

¹Edit: almost three million lines of Python!!

1 Like