Files
WHCandCursor 5538ed3412
ci / tcc-check (push) Successful in 1m8s
ci / linux (aarch64, 0) (push) Failing after 1h0m3s
ci / linux (x86, 1) (push) Failing after 1h0m3s
ci / linux (x86_64, 1) (push) Failing after 1h0m2s
ci / windows (push) Failing after 50s
refactor: archive GUI clients; keep minimal TUI with hooks/API
Move Qt/Tauri/full Web SPA under archive/, ship hermit as CLI/TUI plus
libcstcore and cst-webui/1 HTTP+SSE (turn lifecycle hooks, capabilities).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-30 22:49:23 +08:00

95 lines
3.1 KiB
Nix

# NixOS: archived Qt Quick front end (archive/qt-app). Prefer hermit CLI via
# scripts/bootstrap_linux.sh. Desktop Tauri reference: archive/desktop-tauri.
#
# nix-build # ./result/bin/hermit-app (Qt, frozen)
# nix-env -f . -i hermit
{ pkgs ? import <nixpkgs> { } }:
let
# The version lives in one place: the header the engine and the APK read.
vLine = re:
let
hit = pkgs.lib.findFirst
(l: builtins.match "#define ${re} ([0-9]+)" l != null) ""
(pkgs.lib.splitString "\n" (builtins.readFile ./include/cst_version.h));
in
builtins.head (builtins.match "#define ${re} ([0-9]+)" hit);
in
pkgs.stdenv.mkDerivation {
pname = "hermit";
version =
"${vLine "CST_VERSION_MAJOR"}.${vLine "CST_VERSION_MINOR"}.${vLine "CST_VERSION_PATCH"}";
# Not the whole checkout: third_party/ (the static curl/mbedTLS/ncurses
# sources, the NDK builds), the build directories and the session store are
# gigabytes this build never reads -- curl, ncurses and Qt come from nixpkgs.
src = builtins.filterSource
(path: type:
!(builtins.elem (baseNameOf path) [
".agent"
".cursor"
".gen"
".git"
"build-android-arm64-v8a"
"build-apk-android"
"build-win-tui"
"dist"
"result"
"third_party"
]))
./.;
nativeBuildInputs = with pkgs; [ cmake pkg-config qt6.wrapQtAppsHook ];
# qtwayland so a Wayland session gets a native client, qtsvg for the icon
# theme: Breeze's icons are SVG, and without the image format plugin the
# window falls back to text glyphs.
buildInputs = with pkgs; [
qt6.qtbase
qt6.qtdeclarative
qt6.qtwayland
qt6.qtsvg
curl
curl.dev
ncurses
ncurses.dev
];
cmakeFlags = [ "-DCST_BUILD_APP=ON" "-DCMAKE_BUILD_TYPE=Release" ];
# The "app" component is the window, its launcher entry and the icon;
# archive/qt-app/CMakeLists.txt is the one place that knows where each goes.
installPhase = ''
runHook preInstall
cmake --install . --component app --prefix "$out"
runHook postInstall
'';
doCheck = true;
# One test cannot pass here: tests/test_sandbox.c has the engine run a
# sandboxed command and asserts Landlock *denied* the write outside the
# workspace, and Landlock does not work inside the nix build sandbox -- the
# command succeeds and the assertion trips. The other 40 run; the full set
# is `make check` / `ctest` in the dev tree.
checkPhase = ''
runHook preCheck
ctest --output-on-failure -j"$NIX_BUILD_CORES" -E test_sandbox
runHook postCheck
'';
# The tests write settings, sessions, undo files and a scratch workspace:
# give them a home of their own.
preCheck = ''
export HOME="$TMPDIR/home"
export XDG_CONFIG_HOME="$HOME/.config" XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
mkdir -p "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME" "$XDG_DATA_HOME"
'';
meta = {
description =
"Hermit: archived Qt Quick front end (prefer CLI TUI + --web API)";
homepage = "https://git.whcself.xyz/WHC/Hermit";
platforms = pkgs.lib.platforms.linux;
mainProgram = "cst-agent-app";
};
}