fix(packages): gate codex on platform support
This commit is contained in:
parent
e019a60b4e
commit
15561a3201
3 changed files with 30 additions and 6 deletions
13
flake.nix
13
flake.nix
|
|
@ -228,9 +228,16 @@
|
||||||
|
|
||||||
formatter = forEachSystem (system: (mkPkgs system).nixfmt);
|
formatter = forEachSystem (system: (mkPkgs system).nixfmt);
|
||||||
|
|
||||||
checks = forEachSystem (system: {
|
checks = forEachSystem (
|
||||||
inherit (self.packages.${system}) cf codex;
|
system:
|
||||||
});
|
let
|
||||||
|
customPkgs = self.packages.${system};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit (customPkgs) cf;
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs (customPkgs ? codex) { inherit (customPkgs) codex; }
|
||||||
|
);
|
||||||
|
|
||||||
packages = forEachSystem (
|
packages = forEachSystem (
|
||||||
system:
|
system:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
{ pkgs, llm-agents }:
|
{ pkgs, llm-agents }:
|
||||||
let
|
let
|
||||||
upstream = llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.codex;
|
system = pkgs.stdenv.hostPlatform.system;
|
||||||
|
upstream =
|
||||||
|
if builtins.hasAttr system llm-agents.packages then
|
||||||
|
llm-agents.packages.${system}.codex
|
||||||
|
else
|
||||||
|
throw "codex: llm-agents does not provide packages.${system} (supported: ${builtins.concatStringsSep ", " (builtins.attrNames llm-agents.packages)})";
|
||||||
manifest = pkgs.writeText "codex-package.json" (
|
manifest = pkgs.writeText "codex-package.json" (
|
||||||
builtins.toJSON {
|
builtins.toJSON {
|
||||||
layoutVersion = 1;
|
layoutVersion = 1;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,18 @@
|
||||||
{ pkgs, llm-agents, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
llm-agents,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# llm-agents does not publish every platform (it dropped x86_64-darwin), so
|
||||||
|
# expose codex only where the input provides it.
|
||||||
|
hasCodex = builtins.hasAttr pkgs.stdenv.hostPlatform.system llm-agents.packages;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
cf = pkgs.callPackage ./cf.nix { };
|
cf = pkgs.callPackage ./cf.nix { };
|
||||||
codex = pkgs.callPackage ./codex.nix { inherit llm-agents; };
|
|
||||||
pikpak-cli = pkgs.callPackage ./pikpak-cli.nix { };
|
pikpak-cli = pkgs.callPackage ./pikpak-cli.nix { };
|
||||||
}
|
}
|
||||||
|
// lib.optionalAttrs hasCodex {
|
||||||
|
codex = pkgs.callPackage ./codex.nix { inherit llm-agents; };
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue