From ddfc6cef59f47d6e3713acae619dda1ca4740ed0 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 24 Apr 2025 19:56:27 -0700 Subject: build python packages for llm To get a more recent version of the llm python tool and the anthropic module, we need to build the packages ourselves. Refactor how we're building overlays to make it easier to add new packages using the `pkgsUnstable` set. --- flake.nix | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 9d51051..ac1179c 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,8 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + nixpkgsUnstable.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; @@ -29,6 +31,7 @@ outputs = { nixpkgs, + nixpkgsUnstable, darwin, treefmt-nix, pre-commit-hooks, @@ -37,7 +40,24 @@ let system = "aarch64-darwin"; pkgs = import nixpkgs { inherit system; }; - mkSystem = import ./nix/lib/mkSystem.nix { inherit nixpkgs inputs; }; + pkgsUnstable = import nixpkgsUnstable { inherit system; }; + + # Define overlays here + overlays = [ + (final: _prev: { + sapi = final.callPackage ./pkgs/sapi { }; + hashi = final.callPackage ./pkgs/hashi { }; + llmPython = final.callPackage ./pkgs/llmPython { + inherit pkgsUnstable; + }; + }) + ]; + + mkSystem = import ./nix/lib/mkSystem.nix { + inherit nixpkgs nixpkgsUnstable inputs; + inherit overlays; + }; + treefmtEval = treefmt-nix.lib.evalModule pkgs { projectRootFile = "flake.nix"; programs = { @@ -91,7 +111,7 @@ git (writeScriptBin "nbuild" '' set -e - echo "> Running darwin-rebuild switch..." + echo "> Running darwin-rebuild build..." ${inputs.darwin.packages.${system}.darwin-rebuild}/bin/darwin-rebuild build --flake . echo "> darwin-rebuild build was successful ✅" echo "> macOS config was successfully applied 🚀" -- cgit v1.2.3