os-ai-pr-bot/flake.nix
Brian McKenna 85fd3adec4
Some checks failed
Claude PR Bot / claude-bot (pull_request) Failing after 10s
Add flake
2026-02-14 06:51:17 +11:00

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
];
};
}
);
}