Files
libimg/flake.nix
T
2026-03-26 11:09:34 -04:00

44 lines
1.2 KiB
Nix

{
description = "Image Processor C API";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
}: let
supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in {
packages = forAllSystems (system: let
pkgs = import nixpkgs {inherit system;};
in {
default = pkgs.stdenv.mkDerivation {
pname = "image-processor";
version = "0.1.0";
src = ./.; # Since the flake is in the repo, we use local source
# nativeBuildInputs are tools needed at build time (like CMake)
nativeBuildInputs = [pkgs.cmake pkgs.pkg-config];
# buildInputs are libraries your API depends on (e.g., libpng, opencv)
buildInputs = [];
# Nix automatically runs: cmakeConfigurePhase, buildPhase, installPhase
# You just need to ensure your CMakeLists.txt has 'install()' targets.
};
});
devShells = forAllSystems (system: let
pkgs = import nixpkgs {inherit system;};
in {
default = pkgs.mkShell {
inputsFrom = [self.packages.${system}.default];
packages = [pkgs.gdb];
};
});
};
}