systant/flake.nix
ryan 8a0fa9604c Add Home Assistant development environment to flake
- Add home-assistant and mosquitto to dev shell
- Create minimal dev-config/ for HA development instance
- Symlink custom integration for easy testing
- Add HA dev files to .gitignore
- No HA codebase committed, just references via Nix

Usage:
  nix develop
  hass --config ./dev-config

Features:
- Isolated from production HA instance
- MQTT broker for testing
- Debug logging enabled
- In-memory database for fast iteration
2025-08-02 21:00:07 -07:00

93 lines
2.6 KiB
Nix

{
description = "Elixir system monitor daemon";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
system = system;
config.allowUnfree = true;
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
# Elixir/Erlang for server
elixir
erlang
# AI/Development tools
claude-code
aider-chat
# Node.js tools
nodejs_20
yarn
deno
# Python for Home Assistant integration
python311
python311Packages.pip
python311Packages.ipython
python311Packages.pytest
python311Packages.pytest-homeassistant-custom-component
python311Packages.black
python311Packages.isort
python311Packages.flake8
python311Packages.mypy
# Home Assistant for development
home-assistant
mosquitto
];
shellHook = ''
echo "Systant development environment loaded"
echo "Elixir: $(elixir --version | head -1)"
echo "Python: $(python --version)"
echo "Home Assistant: $(hass --version)"
echo ""
echo "Available tools: pytest, black, isort, flake8, mypy, mosquitto"
echo ""
echo "Directories:"
echo " server/ - Elixir systant daemon"
echo " home-assistant-integration/ - Home Assistant custom integration"
echo " dev-config/ - Home Assistant development configuration"
echo ""
echo "Commands:"
echo " hass --config ./dev-config - Start HA dev instance"
echo " mosquitto - Start MQTT broker for testing"
'';
};
packages = {
default = pkgs.callPackage ./nix/package.nix {
src = ./server;
};
systant = pkgs.callPackage ./nix/package.nix {
src = ./server;
};
};
apps = {
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/systant";
};
};
}
) // {
nixosModules.default = import ./nix/nixos-module.nix;
};
}