portal/flake.nix
Mikael Hugo a3622f29ef feat: elixir 1.20-rc4 flake, AI ops chat (ChatLive + RouterAgent)
- flake.nix: custom elixir_1_20_rc4 derivation via overrideAttrs on
  beamPackages.elixir_1_19 with headless OTP 28; nixos-25.11 pinned
- mix.exs (ops + my): elixir ~> 1.20
- Dockerfile: note 1.19.5 stays until hexpm publishes 1.20 stable image
- New: ChatLive — full-screen AI ops chat with SSE streaming, scroll hook,
  suggestion buttons, typing indicator, clear history
- New: RouterAgent — streams OpenAI-compatible SSE from router-agent svc;
  configurable URL + API key via env; sends {:chunk,t}/:stream_done msgs to LiveView
- Router: add live /chat route under auth pipeline
- Layouts: AI Chat nav link + ScrollBottom JS hook inline
- Application: Finch pool started for RouterAgent HTTP client
- Priv/static: phoenix.min.js + phoenix_live_view.min.js bundled
- Config: ROUTER_AGENT_URL / ROUTER_AGENT_API_KEY in dev.exs + runtime.exs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 11:23:14 +02:00

62 lines
2.1 KiB
Nix

{
description = "CentralCloud unified portal (Elixir/Phoenix umbrella)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
};
nixConfig = {
extra-substituters = [
"https://cache.centralcloud.com/default"
];
extra-trusted-public-keys = [
"default:ywfU21WX06iOn2Ec2lae1jYh4w8LO4IQkmp06vJzsk8="
];
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Erlang OTP 28 without wxwidgets (avoids gstreamer→hotdoc→clang chain)
erlang_28_headless = pkgs.beamPackages.erlang.override {
wxGTK32 = null;
libGL = null;
libGLU = null;
wrapGAppsHook3 = pkgs.buildEnv { name = "empty"; paths = []; };
xorg = { libX11 = null; };
};
# Elixir 1.20.0-rc.4 — not yet in nixpkgs; override elixir_1_19 against headless OTP 28
elixir_1_20_rc4 = (pkgs.beamPackages.elixir_1_19.override {
erlang = erlang_28_headless;
}).overrideAttrs (_old: {
version = "1.20.0-rc.4";
src = pkgs.fetchFromGitHub {
owner = "elixir-lang";
repo = "elixir";
rev = "v1.20.0-rc.4";
hash = "sha256-sboB+GW3T+t9gEcOGtd6NllmIlyWio1+cgWyyxE+484=";
};
});
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
elixir_1_20_rc4 # 1.20.0-rc.4 built from source against OTP 28
erlang_28_headless # OTP 28.5, no wx/gui (headless server use)
nodejs_22 # Phoenix asset pipeline
inotify-tools # LiveReload on Linux
];
shellHook = ''
export MIX_HOME=$HOME/.mix
export HEX_HOME=$HOME/.hex
export PATH=$MIX_HOME/bin:$HEX_HOME/bin:$PATH
echo "Elixir $(elixir --version | head -1)"
echo "Mix $(mix --version)"
'';
};
});
}