2026-07-12 12:55:03 -07:00
|
|
|
{
|
|
|
|
|
description = "Shared Quixos protobuf protocol definitions";
|
|
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
|
};
|
|
|
|
|
|
2026-09-15 15:23:24 -07:00
|
|
|
outputs =
|
|
|
|
|
{
|
|
|
|
|
self,
|
|
|
|
|
nixpkgs,
|
|
|
|
|
flake-utils,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
flake-utils.lib.eachDefaultSystem (
|
|
|
|
|
system:
|
2026-07-12 12:55:03 -07:00
|
|
|
let
|
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
2026-09-03 15:46:52 -07:00
|
|
|
nodejs = pkgs.nodejs_24;
|
2026-11-05 20:56:18 +00:00
|
|
|
quixos-protocol = import ./default.nix {
|
|
|
|
|
inherit pkgs;
|
|
|
|
|
nixpkgsNarHash = nixpkgs.narHash;
|
2026-07-12 12:55:03 -07:00
|
|
|
};
|
2026-09-15 15:23:24 -07:00
|
|
|
in
|
|
|
|
|
{
|
2026-07-12 12:55:03 -07:00
|
|
|
packages.default = quixos-protocol;
|
2026-09-15 20:13:10 -07:00
|
|
|
packages.inspector = (pkgs.callPackage ./yarn-project.nix { inherit nodejs; }) {
|
2026-09-10 00:07:05 -07:00
|
|
|
src = pkgs.lib.fileset.toSource {
|
|
|
|
|
root = ./.;
|
2026-09-15 15:23:24 -07:00
|
|
|
fileset = pkgs.lib.fileset.unions [
|
|
|
|
|
./package.json
|
|
|
|
|
./yarn.lock
|
|
|
|
|
./.yarnrc.yml
|
|
|
|
|
./.yarn/plugins
|
|
|
|
|
./src
|
|
|
|
|
];
|
2026-09-10 00:07:05 -07:00
|
|
|
};
|
|
|
|
|
overrideAttrs = old: {
|
2026-09-15 15:23:24 -07:00
|
|
|
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.esbuild ];
|
2026-09-10 00:07:05 -07:00
|
|
|
doCheck = false;
|
|
|
|
|
buildPhase = ''
|
|
|
|
|
esbuild src/capability-language/inspect-cli.ts --bundle --platform=node --target=node24 --format=esm --outfile=inspect.mjs
|
|
|
|
|
'';
|
|
|
|
|
installPhase = ''
|
|
|
|
|
mkdir -p "$out/bin" "$out/lib"
|
|
|
|
|
cp inspect.mjs "$out/lib/inspect.mjs"
|
|
|
|
|
printf '#!${pkgs.runtimeShell}\nexec ${nodejs}/bin/node --max-old-space-size=128 %s/lib/inspect.mjs\n' "$out" > "$out/bin/quixos-qx-inspect"
|
|
|
|
|
chmod +x "$out/bin/quixos-qx-inspect"
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
2026-09-03 15:46:52 -07:00
|
|
|
checks.default = quixos-protocol;
|
2026-07-12 12:55:03 -07:00
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
|
packages = [
|
2026-09-03 15:46:52 -07:00
|
|
|
nodejs
|
2026-07-12 12:55:03 -07:00
|
|
|
pkgs.protobuf
|
2026-09-03 15:46:52 -07:00
|
|
|
quixos-protocol.yarn-freestanding
|
2026-07-12 12:55:03 -07:00
|
|
|
quixos-protocol
|
|
|
|
|
];
|
|
|
|
|
shellHook = ''
|
|
|
|
|
if [ -n "''${PS1-}" ]; then
|
|
|
|
|
if [ -n "''${QX_DEV_SHELL_PROMPT-}" ]; then
|
|
|
|
|
PS1="''${PS1#\[qx:''${QX_DEV_SHELL_PROMPT}\] }"
|
|
|
|
|
fi
|
|
|
|
|
export QX_DEV_SHELL_PROMPT="quixos-protocol"
|
|
|
|
|
PS1="[qx:quixos-protocol] $PS1"
|
|
|
|
|
fi
|
|
|
|
|
export QUIXOS_PROTO_PATH="${pkgs.protobuf}/include:$PWD/proto''${QUIXOS_PROTO_PATH:+:$QUIXOS_PROTO_PATH}"
|
|
|
|
|
'';
|
|
|
|
|
};
|
2026-09-15 15:23:24 -07:00
|
|
|
}
|
|
|
|
|
);
|
2026-07-12 12:55:03 -07:00
|
|
|
}
|