-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (50 loc) · 1.54 KB
/
flake.nix
File metadata and controls
56 lines (50 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "Development Nix flake for Nori Codex CLI";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { nixpkgs, ... }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems f;
in
{
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
codex-rs = pkgs.callPackage ./codex-rs { };
in
{
codex-rs = codex-rs;
default = codex-rs;
}
);
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# mold is Linux-only, use system linker on macOS
linkerPkgs = if pkgs.stdenv.isLinux then [ pkgs.mold pkgs.clang ] else [ ];
in
{
default = pkgs.mkShell {
# Inherit build dependencies from package definition
inputsFrom = [ (pkgs.callPackage ./codex-rs { }) ];
# Additional dev tools (Rust toolchain managed by rustup)
buildInputs = linkerPkgs ++ [
pkgs.sccache
];
shellHook = ''
# OpenSSL library path for runtime
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ pkgs.openssl ]}:$LD_LIBRARY_PATH
# Enable sccache
export RUSTC_WRAPPER=${pkgs.sccache}/bin/sccache
export SCCACHE_CACHE_SIZE=10G
'';
};
}
);
};
}