Files
logos-cpp-sdk/flake.nix

87 lines
2.7 KiB
Nix
Raw Permalink Normal View History

2025-10-02 16:38:34 -04:00
{
description = "Logos C++ SDK";
2026-03-19 17:39:45 -04:00
inputs.logos-nix.url = "github:logos-co/logos-nix";
inputs.nixpkgs.follows = "logos-nix/nixpkgs";
2025-10-02 16:38:34 -04:00
2026-03-19 17:39:45 -04:00
outputs = { self, nixpkgs, logos-nix }:
2025-10-02 16:38:34 -04:00
let
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
packages = forAllSystems ({ pkgs }:
let
2025-10-23 09:54:45 -04:00
# Common configuration
common = import ./nix/default.nix { inherit pkgs; };
src = ./.;
# Individual package components
bin = import ./nix/bin.nix { inherit pkgs common src; };
lib = import ./nix/lib.nix { inherit pkgs common src; };
include = import ./nix/include.nix { inherit pkgs common src; };
2026-03-24 10:14:17 -04:00
tests = import ./nix/tests.nix { inherit pkgs common src; };
2025-10-23 09:54:45 -04:00
2026-05-07 12:27:14 -03:00
# Combined SDK package. We re-declare propagatedBuildInputs on
# the join so downstream Nix derivations that depend on the
# combined `sdk` (rather than the nested `lib`) still inherit
# OpenSSL / Boost / nlohmann_json — symlinkJoin doesn't
# forward propagation from its `paths` attribute. Qt is
# excluded for the same setup-hook ordering reason as in
# `nix/lib.nix`; consumers must list qt6.qtbase +
# qt6.wrapQtAppsNoGuiHook themselves.
2025-10-23 09:54:45 -04:00
sdk = pkgs.symlinkJoin {
name = "logos-cpp-sdk";
paths = [ bin lib include ];
2026-05-07 12:27:14 -03:00
propagatedBuildInputs = common.propagatedBuildInputs;
};
in
{
2025-10-23 09:54:45 -04:00
# Individual outputs
logos-cpp-bin = bin;
logos-cpp-lib = lib;
logos-cpp-include = include;
2026-03-24 10:14:17 -04:00
inherit tests;
2025-10-23 09:54:45 -04:00
# Combined outputs (for backward compatibility)
logos-cpp-sdk = sdk;
2025-10-23 09:54:45 -04:00
cpp-generator = bin; # Alias for backward compatibility
# Default package
default = sdk;
}
);
2025-10-02 16:38:34 -04:00
checks = forAllSystems ({ pkgs }:
let
common = import ./nix/default.nix { inherit pkgs; };
src = ./.;
tests = import ./nix/tests.nix { inherit pkgs common src; };
in
{
inherit tests;
}
);
2025-10-02 16:38:34 -04:00
devShells = forAllSystems ({ pkgs }: {
default = pkgs.mkShell {
nativeBuildInputs = [
pkgs.cmake
pkgs.ninja
pkgs.pkg-config
];
buildInputs = [
pkgs.qt6.qtbase
pkgs.qt6.qtremoteobjects
2026-03-24 10:14:17 -04:00
pkgs.gtest
2026-05-07 12:27:14 -03:00
pkgs.boost
pkgs.openssl
pkgs.nlohmann_json
2025-10-02 16:38:34 -04:00
];
};
});
};
}