Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
62 lines (59 loc) · 2.03 KB
/
Copy pathflake.nix
File metadata and controls
62 lines (59 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
description = "FlowChat — branched LLM chat canvas (Flask + jsPlumb Community Edition)";
inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: builtins.listToAttrs (map (s: { name = s; value = f s; }) systems);
pythonFor = system:
let
pkgs = import nixpkgs { inherit system; };
in
pkgs.python3.withPackages (ps: [
ps.flask
ps.flask-cors
ps.openai
ps.httpx
]);
in
{
devShells = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.mkShell {
packages = [
(pythonFor system)
pkgs.nodejs_22
pkgs.git
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.chromium ];
shellHook = ''
# Point Puppeteer at Nix's Chromium and skip its own (broken-on-NixOS,
# Debian-based) Chrome download. macOS keeps the auto-download fallback.
if [ "$(uname -s)" = Linux ]; then
export PUPPETEER_EXECUTABLE_PATH="${pkgs.chromium}/bin/chromium"
export PUPPETEER_SKIP_DOWNLOAD=1
fi
echo "FlowChat devShell ready — python3 (Flask) + nodejs + chromium (Puppeteer tests)"
'';
};
});
apps = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };
server = pkgs.writeShellApplication {
name = "flowchat-server";
runtimeInputs = [ (pythonFor system) ];
text = ''exec python3 "${self}/backend/app.py"'';
};
in
{
default = {
type = "app";
program = "${server}/bin/flowchat-server";
meta.description = "FlowChat — branched LLM chat canvas (Flask dev server)";
};
});
};
}