nix-vcpkg-cross-experiment/flake.nix

60 lines
1.3 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }: let
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
"armv7l-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
(prev: final: {
vcpkg-tool = final.callPackage ./nix/packages/vcpkg-tool/package.nix { };
})
];
};
in f system pkgs);
inherit (nixpkgs) lib;
in {
packages = forAllSystems (system: pkgs: {
default = self.packages.${system}.test;
test = pkgs.callPackage ./nix/packages/test/package.nix {
src = ./.;
};
});
devShells = forAllSystems (system: pkgs: {
default = self.devShells.${system}.vcpkgVendoredLibs;
vcpkgVendoredLibs = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
vcpkg
cmake
];
env = {
VCPKG_ROOT = "${pkgs.vcpkg}/share/vcpkg";
};
};
nixVendoredLibs = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cmake
];
buildInputs = with pkgs; [
nlohmann_json
fmt
];
};
});
};
}