44 lines
1.3 KiB
Nix
44 lines
1.3 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
claude-code-nix = {
|
|
url = "github:sadjow/claude-code-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils, claude-code-nix }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
claude-code = claude-code-nix.packages.${system}.claude-code;
|
|
|
|
# Build the Haskell package
|
|
unwrapped = pkgs.haskell.lib.justStaticExecutables
|
|
(pkgs.haskellPackages.callCabal2nix "os-ai-pr-bot" ./. {});
|
|
|
|
# Wrap with claude on PATH
|
|
wrapped = pkgs.runCommand "os-ai-pr-bot" {
|
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
|
} ''
|
|
mkdir -p $out/bin
|
|
makeWrapper ${unwrapped}/bin/os-ai-pr-bot $out/bin/os-ai-pr-bot \
|
|
--prefix PATH : ${pkgs.lib.makeBinPath [ claude-code ]}
|
|
'';
|
|
in {
|
|
packages.default = wrapped;
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = [
|
|
pkgs.cabal-install
|
|
pkgs.haskellPackages.ghc
|
|
pkgs.zlib
|
|
pkgs.pkg-config
|
|
claude-code
|
|
];
|
|
};
|
|
}
|
|
);
|
|
}
|