Commit Graph

20 Commits

Author SHA1 Message Date
e7b0287847 Simplify HA dev config to work with core-only Nix package
- Remove frontend dependencies that aren't in Nix package
- Use minimal config with just HTTP, API, and MQTT
- Prepare for either Docker alternative or core-only testing
2025-08-02 21:15:46 -07:00
2491f8433b Fix flake.nix by removing non-existent pytest-homeassistant-custom-component package 2025-08-02 21:08:44 -07:00
8bf3f9e96a Update HA dev config to use existing mqtt.home broker
- Remove mosquitto from flake (use existing broker)
- Point dev config to mqtt.home instead of localhost
- Cleaner setup using your existing MQTT infrastructure
2025-08-02 21:01:45 -07:00
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
c7949285d1 Add Home Assistant custom integration for Systant
- Create basic integration structure with manifest.json
- Add config flow for easy setup via UI
- Implement MQTT-based host discovery and sensor creation
- Auto-discover Systant hosts via systant/+/stats topic
- Create device entities with last_seen sensor for each host
- Add Python tooling to flake.nix for HA development

Integration features:
- Automatic host discovery via MQTT
- Device representation for each monitored host
- Extensible sensor architecture
- Proper Home Assistant integration patterns
2025-08-02 20:19:57 -07:00
36e590becb Fix COOKIE issue by setting RELEASE_COOKIE environment variable
- Remove dummy COOKIE file creation (doesn't work in Nix store)
- Set RELEASE_COOKIE env var in wrapper script instead
- This follows NixOS best practices for Elixir releases
2025-08-02 20:14:24 -07:00
8cbad5c849 Create dummy COOKIE file in Nix package to avoid runtime error 2025-08-02 20:09:57 -07:00
495152826f Fix COOKIE error by disabling cookies in release config 2025-08-02 20:08:54 -07:00
9b3b7ab39b Add COOKIE workaround for Nix package 2025-08-02 20:06:57 -07:00
289bb00f82 Fix Nix build by removing accidentally committed build artifacts
- Remove server/_build/ and server/deps/ from git tracking
- Update .gitignore to properly ignore server build directories
- These directories caused symlink conflicts in Nix build

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 19:56:47 -07:00
b6769abbe9 Restructure as monorepo and add flake packages/apps
- Move Elixir code to server/ subdirectory for monorepo structure
- Update flake.nix to provide packages and apps outputs for nix run support
- Update nix/package.nix to accept src parameter instead of fetchgit
- Add NixOS module export for easy consumption

Now supports: nix run, nix build, and nix develop from git repo

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 19:54:17 -07:00
46e585ec92 Clean up Nix configuration and remove old files
- Move Nix package and module to nix/ directory for better organization
- Remove old Nix files (systant.nix, systant-old.nix, etc.)
- Remove debug script and systemd service file
- Update config files for new Nix structure
- Add CLAUDE.md with project documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 19:41:40 -07:00
e217c7b180 Add flake.nix 2025-08-02 19:14:04 -07:00
d1e497cdc2 Add hostname-aware MQTT topics
- Topics now default to systant/{hostname}/stats and systant/{hostname}/commands
- Runtime config automatically includes system hostname in topics
- NixOS module defaults use config.networking.hostName
- Supports multiple hosts without topic conflicts
- Environment variables can still override if needed

Example: systant/orion/stats, systant/server2/stats, etc.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 18:59:46 -07:00
248f3f88e6 Bypass COOKIE file requirement in systemd service
Set RELEASE_COOKIE environment variable directly in systemd service
to prevent startup script from trying to read non-existent COOKIE file.

The environment variable takes precedence over file reading.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 18:20:08 -07:00
54f8d23945 Remove COOKIE complexity - disable distributed Erlang
- Remove explicit cookie configuration from release
- Set RELEASE_DISTRIBUTION=none and RELEASE_NODE=nonode@nohost
- Simplify Nix derivation by removing postInstall hooks
- Single standalone daemon doesn't need Erlang node clustering

Fixes persistent COOKIE file issues in Nix builds.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 18:15:11 -07:00
f8173a1afb Fix COOKIE file missing in Nix build
- Add postInstall hook to ensure COOKIE file exists
- Include ERTS and disable beam stripping in release config
- Handle mixRelease differences from local builds

This ensures the Elixir release works properly when built via Nix.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 18:00:37 -07:00
9d8ad1890b Fix Elixir release configuration
- Add explicit cookie to release config to fix missing COOKIE file
- Add config/runtime.exs for environment-based configuration
- Release now supports runtime environment variables
- Binary starts successfully without COOKIE errors

Environment variables supported:
- SYSTANT_MQTT_HOST, SYSTANT_MQTT_PORT
- SYSTANT_MQTT_USERNAME, SYSTANT_MQTT_PASSWORD
- SYSTANT_STATS_TOPIC, SYSTANT_COMMAND_TOPIC
- SYSTANT_PUBLISH_INTERVAL

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 17:48:24 -07:00
92fc90e3b4 Rename project from system-stats-daemon to systant
- Updated all module names from SystemStatsDaemon to Systant
- Renamed application config from :system_stats_daemon to :systant
- Updated service files and documentation
- Release binary now at _build/prod/rel/systant/bin/systant

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 17:06:03 -07:00
9d8306a64b Initial commit: Elixir MQTT system stats daemon
- MQTT client with configurable broker connection
- Periodic system stats publishing (30s interval)
- Command listening on MQTT topic with logging
- Systemd service configuration
- NixOS module for declarative deployment

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 16:56:10 -07:00