From ccdc188234243bb5e996ebf80c89cd19e9a950da Mon Sep 17 00:00:00 2001 From: osbm Date: Thu, 23 Oct 2025 13:52:41 +0300 Subject: [PATCH] multi system flake --- flake.nix | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index 66be015..4363287 100644 --- a/flake.nix +++ b/flake.nix @@ -7,22 +7,29 @@ gradle-dot-nix.url = "github:CrazyChaoz/gradle-dot-nix"; }; outputs = - inputs: + inputs@{ nixpkgs, android-nixpkgs, gradle2nix, gradle-dot-nix, ... }: let - system = "x86_64-linux"; - pkgs = import inputs.nixpkgs { - inherit system; - config = { - allowUnfree = true; - - android_sdk.accept_license = true; - }; - }; - - myLib = pkgs.callPackage ./lib { inherit inputs; }; + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); in { - packages.x86_64-linux = myLib.byNameOverlay ./apks; - lib = myLib; + packages = forAllSystems (system: + let + pkgs = import nixpkgs { + inherit system; + config = { + allowUnfree = true; + android_sdk.accept_license = true; + }; + }; + myLib = pkgs.callPackage ./lib { inherit inputs; }; + in + myLib.byNameOverlay ./apks + ); }; }