Previously, the `nix build .#default` command fails due to a missing
output hash in the `./codex-rs/default.nix` for `crossterm-0.28.1`:
```
error: No hash was found while vendoring the git dependency crossterm-0.28.1. You can add
a hash through the `outputHashes` argument of `importCargoLock`:
outputHashes = {
"crossterm-0.28.1" = "<hash>";
};
If you use `buildRustPackage`, you can add this attribute to the `cargoLock`
attribute set.
```
This PR adds the missing hash:
```diff
cargoLock.outputHashes = {
"ratatui-0.29.0" = "sha256-HBvT5c8GsiCxMffNjJGLmHnvG77A6cqEL+1ARurBXho=";
+ "crossterm-0.28.1" = "sha256-6qCtfSMuXACKFb9ATID39XyFDIEMFDmbx6SSmNe+728=";
};
```
With this change, `nix build .#default` succeeds:
```
> nix build .#default --max-jobs 1 --cores 2
warning: Git tree '/home/lukas/r/github.com/lukasl-dev/codex' is dirty
[1/0/1 built] building codex-rs-0.1.0 (buildPhase)[1/0/1 built] building codex-rs-0.1.0 (buildP[1/0/1 built] building codex-rs-0.1.0 (buildPhase): [1/0/1 built] building codex-rs-0.1.0 (b[1/0/1 built] building codex-rs-0.1.0 (buildPhase): Compi[1/0/1 built] building codex-rs-0.1
> ./result/bin/codex
You are running Codex in /home/lukas/r/github.com/lukasl-dev/codex
Since this folder is version controlled, you may wish to allow Codex to work in this folder without asking for approval.
...
```
33 lines
731 B
Nix
33 lines
731 B
Nix
{
|
||
openssl,
|
||
rustPlatform,
|
||
pkg-config,
|
||
lib,
|
||
...
|
||
}:
|
||
rustPlatform.buildRustPackage (_: {
|
||
env = {
|
||
PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig:$PKG_CONFIG_PATH";
|
||
};
|
||
pname = "codex-rs";
|
||
version = "0.1.0";
|
||
cargoLock.lockFile = ./Cargo.lock;
|
||
doCheck = false;
|
||
src = ./.;
|
||
nativeBuildInputs = [
|
||
pkg-config
|
||
openssl
|
||
];
|
||
|
||
cargoLock.outputHashes = {
|
||
"ratatui-0.29.0" = "sha256-HBvT5c8GsiCxMffNjJGLmHnvG77A6cqEL+1ARurBXho=";
|
||
"crossterm-0.28.1" = "sha256-6qCtfSMuXACKFb9ATID39XyFDIEMFDmbx6SSmNe+728=";
|
||
};
|
||
|
||
meta = with lib; {
|
||
description = "OpenAI Codex command‑line interface rust implementation";
|
||
license = licenses.asl20;
|
||
homepage = "https://github.com/openai/codex";
|
||
};
|
||
})
|