myxce/src/nixSupport/xce.nix
Rongsong Shen 798f19b83a feat(admin-config-tool): task 1.3 - nix and xce-build.sh integration
Add python3 + pycapnp/pyyaml/jsonschema/click/pytest/ruff (+pip) to the
nix dev shell, wire a new `xceadmin` case into xce-build.sh (schema
sync from src/schema/ and src/configs/schema/, pip install by profile,
pytest), package-data config so bundled schemas survive a non-editable
install, xce-build SKILL.md docs, and ruff format/check hooks matching
this repo's stdin-JSON hook convention (not brief.md's env-var sketch,
which would have silently no-op'd).

Verified live end-to-end inside `nix develop ./src` for both the
default (editable) and release (pinned) profiles; found and fixed 3
real bugs along the way (missing pip, PEP 668 externally-managed-
environment, missing package-data for release-profile bundling) —
logged as bug-1458/1459/1460.

Requirements: 5.5, 8.1, 8.2, 8.6
2026-07-22 03:57:43 +00:00

97 lines
2.1 KiB
Nix

{
lib,
stdenv,
pkgs,
myCommitId,
withDebug? false,
withAsan? false,
...
}:
stdenv.mkDerivation {
pname = "xcecore";
version = "0.0.1";
src = ./..;
nativeBuildInputs = with pkgs; [
meson
ninja
capnproto
pkg-config
cmake
go
go-swag # swagger doc generation: swag init
gotools # goimports, godoc
gopls # Go language server
delve # Go debugger
(openssl.overrideAttrs (oldAttrs: {
separateDebugInfo = true;
}))
libtirpc
readline
ncurses
struct2json
(capnpc.overrideAttrs (oldAttrs: {
separateDebugInfo = true;
}))
which
findutils
(libuv.overrideAttrs (oldAttrs: {
separateDebugInfo = true;
}))
(elogind.overrideAttrs (oldAttrs: {
separateDebugInfo = true;
}))
(sqlite.overrideAttrs (oldAttrs: {
separateDebugInfo = true;
}))
(hwloc.overrideAttrs (oldAttrs: {
separateDebugInfo = true;
}))
linux-pam
tinylog
unity_test_with_color
libcyaml
libyaml
libcgroup
(extralib.overrideAttrs (oldAttrs: {
separateDebugInfo = true;
}))
packcc
cacert
# Python — for xceadmin (admin config tool, src/xceadmin/). pycapnp links
# against the capnproto C++ runtime above; nix's python3Packages.pycapnp
# handles that link correctly, unlike a plain `pip install pycapnp`.
# See .kiro/specs/admin-config-tool/brief.md "Nix Environment".
python3
python3Packages.pip
python3Packages.pycapnp
python3Packages.pyyaml
python3Packages.jsonschema
python3Packages.click
python3Packages.pytest
python3Packages.ruff
] ++ (if withDebug then [
(librtti_debug.overrideAttrs (oldattrs: {
separateDebugInfo = true;
}))
] else [
librtti
]);
build-system = [ pkgs.meson ];
dontStrip = (withDebug || withAsan);
separateDebugInfo = (withDebug || withAsan);
impureEnvVars = [ "HOME" ];
mesonFlags =[
(lib.optional withDebug "--buildtype=debug")
(lib.optional withAsan "-Db_sanitize=address")
("-Dcommit_id=" + myCommitId)
"-Dcomponent=xcecore"
];
}