2025-10-15 11:17:02 +02:00
|
|
|
{
|
|
|
|
|
description = "Nim-SDS build flake";
|
|
|
|
|
|
|
|
|
|
nixConfig = {
|
|
|
|
|
extra-substituters = [ "https://nix-cache.status.im/" ];
|
|
|
|
|
extra-trusted-public-keys = [ "nix-cache.status.im-1:x/93lOfLU+duPplwMSBR+OlY4+mo+dCN7n0mr4oPwgY=" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
inputs = {
|
2026-01-30 11:45:07 +01:00
|
|
|
# We are pinning the commit because ultimately we want to use same commit across different projects.
|
2026-02-11 16:32:02 +01:00
|
|
|
# A commit from nixpkgs 25.11 release : https://github.com/NixOS/nixpkgs/tree/release-25.11
|
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs?rev=23d72dabcb3b12469f57b37170fcbc1789bd7457";
|
2025-10-15 11:17:02 +02:00
|
|
|
};
|
|
|
|
|
|
2026-02-11 16:32:02 +01:00
|
|
|
outputs = { self, nixpkgs }:
|
2025-10-15 11:17:02 +02:00
|
|
|
let
|
|
|
|
|
stableSystems = [
|
|
|
|
|
"x86_64-linux" "aarch64-linux"
|
|
|
|
|
"x86_64-darwin" "aarch64-darwin"
|
2025-10-22 02:13:39 +02:00
|
|
|
"x86_64-windows"
|
2025-10-15 11:17:02 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
forAllSystems = f: nixpkgs.lib.genAttrs stableSystems (system: f system);
|
|
|
|
|
|
|
|
|
|
pkgsFor = forAllSystems (
|
|
|
|
|
system: import nixpkgs {
|
|
|
|
|
inherit system;
|
|
|
|
|
config = {
|
|
|
|
|
android_sdk.accept_license = true;
|
|
|
|
|
allowUnfree = true;
|
|
|
|
|
};
|
|
|
|
|
overlays = [
|
|
|
|
|
(final: prev: {
|
|
|
|
|
androidEnvCustom = prev.callPackage ./nix/pkgs/android-sdk { };
|
|
|
|
|
androidPkgs = final.androidEnvCustom.pkgs;
|
|
|
|
|
androidShell = final.androidEnvCustom.shell;
|
|
|
|
|
})
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
in rec {
|
|
|
|
|
packages = forAllSystems (system: let
|
|
|
|
|
pkgs = pkgsFor.${system};
|
2026-01-30 11:45:07 +01:00
|
|
|
|
|
|
|
|
buildTargets = pkgs.callPackage ./nix/default.nix {
|
2025-10-15 11:17:02 +02:00
|
|
|
src = self;
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-11 16:32:02 +01:00
|
|
|
# All potential targets
|
|
|
|
|
allTargets = [
|
|
|
|
|
"libsds"
|
2026-01-30 11:45:07 +01:00
|
|
|
"libsds-android-arm64"
|
|
|
|
|
"libsds-android-amd64"
|
|
|
|
|
"libsds-android-x86"
|
|
|
|
|
"libsds-android-arm"
|
2026-02-11 16:32:02 +01:00
|
|
|
"libsds-ios"
|
2026-01-30 11:45:07 +01:00
|
|
|
];
|
|
|
|
|
|
2026-02-11 16:32:02 +01:00
|
|
|
# Create a package for each target
|
|
|
|
|
allPackages = builtins.listToAttrs (map (t: {
|
|
|
|
|
name = t;
|
|
|
|
|
value = buildTargets.override { targets = [ t ]; };
|
|
|
|
|
}) allTargets);
|
|
|
|
|
in
|
|
|
|
|
allPackages // {
|
|
|
|
|
default = allPackages.libsds;
|
|
|
|
|
}
|
|
|
|
|
);
|
2025-10-24 11:58:15 +02:00
|
|
|
|
2026-01-30 11:45:07 +01:00
|
|
|
devShells = forAllSystems (system: {
|
|
|
|
|
default = pkgsFor.${system}.callPackage ./nix/shell.nix {
|
|
|
|
|
};
|
2025-10-24 11:58:15 +02:00
|
|
|
});
|
2025-10-15 11:17:02 +02:00
|
|
|
};
|
2025-10-24 11:58:15 +02:00
|
|
|
|
2025-10-15 11:17:02 +02:00
|
|
|
}
|