summaryrefslogtreecommitdiff
path: root/Omni/Dev/Beryllium/Ava.nix
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-25 17:46:45 -0500
committerBen Sima <ben@bensima.com>2025-12-25 17:46:45 -0500
commitc73442d776b3b4889b1f7985f776d8310c6c4b7c (patch)
treebf0de5f641a4020546d6f19c9686ecf343ea55b1 /Omni/Dev/Beryllium/Ava.nix
parent7c9e32f4dee52433911b7e82a72566dc8b5b5708 (diff)
Omni/Dev: convert Ava to dynamic deployment
- Create Omni/Dev/Packages.nix with ava, deployer, deploy-manifest packages - Add biz-deployer service to Beryllium.nix - Remove static systemd service from Ava.nix (keep user/dirs setup) Ava is now deployed via the mini-PaaS system rather than being a static NixOS service. This enables fast Ava updates without full NixOS rebuilds - just build, push closure, update manifest. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'Omni/Dev/Beryllium/Ava.nix')
-rw-r--r--Omni/Dev/Beryllium/Ava.nix89
1 files changed, 4 insertions, 85 deletions
diff --git a/Omni/Dev/Beryllium/Ava.nix b/Omni/Dev/Beryllium/Ava.nix
index 7563b26..890ec53 100644
--- a/Omni/Dev/Beryllium/Ava.nix
+++ b/Omni/Dev/Beryllium/Ava.nix
@@ -1,88 +1,7 @@
-{...}: let
- bild = import ../../Bild.nix {};
- avaPkg = bild.run ../../Ava.hs;
-
- # Python environment for Ava's python_exec tool
- avaPython = bild.python.pythonWith (p: [
- p.requests # HTTP requests
- p.httpx # Async HTTP
- p.beautifulsoup4 # HTML/XML parsing
- p.lxml # Fast XML/HTML parser
- p.pandas # Data analysis
- p.numpy # Numerical computing
- p.pillow # Image processing
- p.pyyaml # YAML parsing
- p.python-dateutil # Date utilities
- ]);
-
- # Nixpkgs for CLI tools not in bild.pkgs
- nixpkgs = import ../../Bild/Nixpkgs.nix;
- pkgs = nixpkgs.nixos-24_11;
-
- # Wrap ava binary with tools in PATH
- avaWithTools = bild.stdenv.mkDerivation {
- name = "ava-wrapped";
- buildInputs = [bild.makeWrapper];
- phases = ["installPhase"];
- installPhase = ''
- mkdir -p $out/bin
- makeWrapper ${avaPkg}/bin/ava $out/bin/ava \
- --prefix PATH : ${bild.lib.makeBinPath [
- avaPython
- bild.pkgs.jq
- bild.pkgs.ripgrep
- bild.pkgs.coreutils
- bild.pkgs.git
- bild.pkgs.sqlite
- bild.pkgs.ffmpeg
- bild.pkgs.bash
- pkgs.curl
- pkgs.pandoc
- pkgs.imagemagick
- pkgs.csvkit
- pkgs.openai-whisper-cpp
- pkgs.direnv
- pkgs.nix
- ]}
- '';
- };
-in {
- systemd.services.ava = {
- description = "Ava Telegram assistant";
- after = ["network-online.target" "ollama.service"];
- wants = ["network-online.target" "ollama.service"];
- wantedBy = ["multi-user.target"];
-
- serviceConfig = {
- Type = "simple";
- User = "ava";
- Group = "users";
- WorkingDirectory = "/home/ava/omni";
-
- Environment = [
- "AVA_DATA_ROOT=/home/ava"
- "HOME=/home/ava"
- "OLLAMA_URL=http://localhost:11434"
- "AVA_WEB_PORT=8079"
- "AVA_WEB_URL=https://beryllium.oryx-ide.ts.net"
- ];
-
- EnvironmentFile = "/run/secrets/ava.env";
-
- ExecStart = "${avaWithTools}/bin/ava";
-
- StandardOutput = "journal";
- StandardError = "journal";
-
- Restart = "on-failure";
- RestartSec = 5;
-
- TimeoutStopSec = 90;
- KillMode = "mixed";
- KillSignal = "SIGTERM";
- };
- };
-
+# Ava user and directory setup.
+# The Ava service itself is deployed dynamically via biz-deployer.
+# This module only creates the user, directories, and activation scripts.
+{...}: {
systemd.tmpfiles.rules = [
"d /home/ava 0755 ava users -"
"d /home/ava/omni 0755 ava users -"