mirror of
https://github.com/Swarsel/nixos-home-assistant.git
synced 2026-11-05 11:21:37 +01:00
Nix flake to allow declarative management of Home Assistant
declarative-config
declarative-configuration
home-assistant
home-assistant-config
home-assistant-configuration
nix-flake
nixos-flake
nixos-module
nixos-modules
- Nix 100%
| nix | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| pedantix.toml | ||
| README.md | ||
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.