Skip to content

Commit

Permalink
Define more binaries on other platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Jun 18, 2024
1 parent 6aa89c7 commit 238e7b7
Showing 1 changed file with 31 additions and 35 deletions.
66 changes: 31 additions & 35 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,37 @@
outputs = inputs @ { nixpkgs, crane, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem
(localSystem: {
packages = {
holochain_aarch64-linux = import ./modules/holochain-cross.nix {
inherit localSystem inputs;
crate = "holochain";
package = "holochain";
crossSystem = "aarch64-linux";
rustTargetTriple = "aarch64-unknown-linux-gnu";
};
holochain_x86_64-linux = import ./modules/holochain-cross.nix {
inherit localSystem inputs;
crate = "holochain";
package = "holochain";
crossSystem = "x86_64-linux";
rustTargetTriple = "x86_64-unknown-linux-gnu";
};
holochain_x86_64-windows = import ./modules/holochain-windows.nix {
inherit localSystem inputs;
crate = "holochain";
package = "holochain";
};

holochain_cli_x86_64-windows = import ./modules/holochain-windows.nix {
inherit localSystem inputs;
crate = "hc";
package = "holochain_cli";
};
} // (if localSystem == "aarch64-darwin" then {
holochain_aarch64-apple = import ./modules/holochain-cross.nix {
inherit localSystem inputs;
crate = "holochain";
package = "holochain";
crossSystem = "aarch64-darwin";
rustTargetTriple = "aarch64-apple-darwin";
};
} else { });
packages =
let
defineHolochainPackages = { crate, package }: {
"${package}_aarch64-linux" = import ./modules/holochain-cross.nix {
inherit localSystem inputs crate package;
crossSystem = "aarch64-linux";
rustTargetTriple = "aarch64-unknown-linux-gnu";
};
"${package}_x86_64-linux" = import ./modules/holochain-cross.nix {
inherit localSystem inputs crate package;
crossSystem = "x86_64-linux";
rustTargetTriple = "x86_64-unknown-linux-gnu";
};
"${package}_x86_64-windows" = import ./modules/holochain-windows.nix {
inherit localSystem inputs crate package;
};
} // (if localSystem == "aarch64-darwin" then {
# Only define darwin builds if we're on a darwin host because Apple don't like people cross compiling
# from other systems.
"${package}_aarch64-apple" = import ./modules/holochain-cross.nix {
inherit localSystem inputs crate package;
crossSystem = "aarch64-darwin";
rustTargetTriple = "aarch64-apple-darwin";
};
} else { });
in
(defineHolochainPackages { crate = "holochain"; package = "holochain"; }) //
(defineHolochainPackages { crate = "hc"; package = "holochain_cli"; }) //
(defineHolochainPackages { crate = "hc_run_local_services"; package = "holochain_cli_run_local_services"; }) //
(defineHolochainPackages { crate = "holochain_terminal"; package = "hcterm"; })
;
}) // {
# Add dev helpers that are not required to be platform agnostic
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
Expand Down

0 comments on commit 238e7b7

Please sign in to comment.