Nix flake to allow declarative management of Home Assistant
Find a file
2026-11-02 01:42:25 +01:00
nix feat[tests]: adopt onboarding areas on rebuild 2026-11-02 01:42:25 +01:00
.gitignore feat: Initial commit 2026-11-01 14:21:36 +01:00
flake.lock feat[tests]: adopt onboarding areas on rebuild 2026-11-02 01:42:25 +01:00
flake.nix feat: tests 2026-11-02 00:14:00 +01:00
LICENSE feat: Initial commit 2026-11-01 14:21:36 +01:00
pedantix.toml feat: Initial commit 2026-11-01 14:21:36 +01:00
README.md docs: add README 2026-11-02 00:14:01 +01:00

nixos-home-assistant

This flake aims to provide a declaratively managed Home Assistant by leveraging home-assistant-provision.

Usage

Add it to your flake.nix inputs:

{
  inputs.nixos-home-assistant.url = "github:Swarsel/nixos-home-assistant";
}

Then, inside a module:

{ config, inputs, ... }:
{
  imports = [ inputs.nixos-home-assistant.nixosModules.default ];

  services.home-assistant = {
    enable = true;
    extraComponents = [ "mqtt" ];
    provision = {
      enable = true;
      owner = {
        name = "Swarsel";
        username = "swarsel";
        passwordFile = config.sops.secrets.home-assistant-owner.path;
      };
      areas = {
        office = { };
        living = {
          name = "Living room";
          icon = "mdi:sofa";
        };
      };
      entries.mqtt = {
        domain = "mqtt";
        steps = [
          {
            broker = "127.0.0.1";
            port = 1883;
            username = "hass";
            password._file = config.sops.secrets.mqtt-password.path;
          }
        ];
      };
    };
  };
}

For instructions on how to use home-assistant-provision, please see its repository.