From 35475da5b87975618632072fbc96840ca52b2346 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Wed, 4 Feb 2026 14:27:52 -0800 Subject: [PATCH] nix-darwin: add claude-code and codex via dedicated flakes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add flake inputs for codex-cli-nix and claude-code-nix with cachix caching for pre-built binaries, matching the NixOS setup. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- nix-darwin/flake.lock | 114 +++++++++++++++++++++++++++++++++++++++++- nix-darwin/flake.nix | 35 +++++++++++-- 2 files changed, 144 insertions(+), 5 deletions(-) diff --git a/nix-darwin/flake.lock b/nix-darwin/flake.lock index 465a4f09..7616fe3a 100644 --- a/nix-darwin/flake.lock +++ b/nix-darwin/flake.lock @@ -8,7 +8,7 @@ "railbird-secrets", "nixpkgs" ], - "systems": "systems" + "systems": "systems_3" }, "locked": { "lastModified": 1707830867, @@ -41,6 +41,48 @@ "type": "github" } }, + "claude-code-nix": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1770168651, + "narHash": "sha256-SxzTEu49iaAA/nAT28Rsr4BmjC3eCkiaM4/ZYBVhhNQ=", + "owner": "sadjow", + "repo": "claude-code-nix", + "rev": "f256f48c037a6e54afa332795328f753f2fafbaf", + "type": "github" + }, + "original": { + "owner": "sadjow", + "repo": "claude-code-nix", + "type": "github" + } + }, + "codex-cli-nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1770232831, + "narHash": "sha256-C5e2wjd//pLJA1LqSYc/y9aZkM8wmZo/BAuzhZDuyFE=", + "owner": "sadjow", + "repo": "codex-cli-nix", + "rev": "64805eb1d1afffcbbcef0ffc053295f0065cd51d", + "type": "github" + }, + "original": { + "owner": "sadjow", + "repo": "codex-cli-nix", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -65,9 +107,45 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "inputs": { "systems": "systems_2" }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_4" + }, "locked": { "lastModified": 1709126324, "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", @@ -229,7 +307,7 @@ "railbird-secrets": { "inputs": { "agenix": "agenix", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_3", "nixpkgs": "nixpkgs_2" }, "locked": { @@ -248,6 +326,8 @@ }, "root": { "inputs": { + "claude-code-nix": "claude-code-nix", + "codex-cli-nix": "codex-cli-nix", "home-manager": "home-manager", "homebrew-cask": "homebrew-cask", "homebrew-core": "homebrew-core", @@ -286,6 +366,36 @@ "repo": "default", "type": "github" } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/nix-darwin/flake.nix b/nix-darwin/flake.nix index d470f4d9..919f25f7 100644 --- a/nix-darwin/flake.nix +++ b/nix-darwin/flake.nix @@ -21,6 +21,16 @@ }; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + codex-cli-nix = { + url = "github:sadjow/codex-cli-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + claude-code-nix = { + url = "github:sadjow/claude-code-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager, ... }: @@ -112,7 +122,14 @@ }; }; - nixpkgs.overlays = [(import ../nixos/overlay.nix)]; + nixpkgs.overlays = [ + (import ../nixos/overlay.nix) + # Use codex and claude-code from dedicated flakes with cachix + (final: prev: { + codex = inputs.codex-cli-nix.packages.${prev.stdenv.hostPlatform.system}.default; + claude-code = inputs.claude-code-nix.packages.${prev.stdenv.hostPlatform.system}.default; + }) + ]; environment.systemPackages = with pkgs; [ #python-with-my-packages emacs @@ -126,7 +143,8 @@ nodejs ripgrep slack - claude-code + claude-code + codex typescript vim yarn @@ -141,7 +159,18 @@ programs.direnv.enable = true; # Necessary for using flakes on this system. - nix.settings.experimental-features = "nix-command flakes"; + nix.settings = { + experimental-features = "nix-command flakes"; + substituters = [ + "https://cache.nixos.org" + "https://codex-cli.cachix.org" + "https://claude-code.cachix.org" + ]; + trusted-public-keys = [ + "codex-cli.cachix.org-1:1Br3H1hHoRYG22n//cGKJOk3cQXgYobUel6O8DgSing=" + "claude-code.cachix.org-1:YeXf2aNu7UTX8Vwrze0za1WEDS+4DuI2kVeWEE4fsRk=" + ]; + }; # Set Git commit hash for darwin-version.