feat: add Nix flake for reproducible development environments (#225)
This PR introduces a Nix flake configuration to enable reproducible development environments: - Adds flake.nix defining a devShell with necessary dependencies. - Updates README.md with usage instructions for `nix develop`. - Ensures CI compatibility with Nix for consistent builds.
This commit is contained in:
51
flake.nix
Normal file
51
flake.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
description = "Development Nix flake for OpenAI Codex CLI";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
node = pkgs.nodejs_22;
|
||||
in rec {
|
||||
packages = {
|
||||
codex-cli = pkgs.buildNpmPackage rec {
|
||||
pname = "codex-cli";
|
||||
version = "0.1.0";
|
||||
src = self + "/codex-cli";
|
||||
npmDepsHash = "sha256-riVXC7T9zgUBUazH5Wq7+MjU1FepLkp9kHLSq+ZVqbs=";
|
||||
nodejs = node;
|
||||
npmInstallFlags = [ "--frozen-lockfile" ];
|
||||
meta = with pkgs.lib; {
|
||||
description = "OpenAI Codex command‑line interface";
|
||||
license = licenses.asl20;
|
||||
homepage = "https://github.com/openai/codex";
|
||||
};
|
||||
};
|
||||
};
|
||||
defaultPackage = packages.codex-cli;
|
||||
devShell = pkgs.mkShell {
|
||||
name = "codex-cli-dev";
|
||||
buildInputs = [
|
||||
node
|
||||
];
|
||||
shellHook = ''
|
||||
echo "Entering development shell for codex-cli"
|
||||
cd codex-cli
|
||||
npm ci
|
||||
npm run build
|
||||
export PATH=$PWD/node_modules/.bin:$PATH
|
||||
alias codex="node $PWD/dist/cli.js"
|
||||
'';
|
||||
};
|
||||
apps = {
|
||||
codex = {
|
||||
type = "app";
|
||||
program = "${packages.codex-cli}/bin/codex";
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user