diff --git a/flake.nix b/flake.nix index 6bfd7f7..4997bb7 100644 --- a/flake.nix +++ b/flake.nix @@ -21,14 +21,16 @@ }; }; - outputs = { self, nixpkgs, flake-utils, rust-overlay, crane}: - flake-utils.lib.eachDefaultSystem (system: - let - overlays = [ (import rust-overlay) ]; + outputs = { self, nixpkgs, flake-utils, rust-overlay, crane}: let + forAllSystems = function: + nixpkgs.lib.genAttrs [ + "x86_64-linux" + "aarch64-linux" + ] (system: let pkgs = import nixpkgs { - inherit system overlays; + inherit system; + overlays = [ (import rust-overlay) ]; }; - rustToolchain = pkgs.rust-bin.stable.latest.default; markdownFilter = path: _type: builtins.match ".*md$" path != null; @@ -51,19 +53,17 @@ bin = craneLib.buildPackage (commonArgs // { inherit cargoArtifacts; }); - - in - with pkgs; - { - packages = { - inherit bin; - default = bin; - }; - devShells.default = mkShell { - inputsFrom = [ bin ]; - }; - - hydraJobs."build" = bin; - } - ); + in function { + inherit bin pkgs; + }); + in { + packages = forAllSystems({pkgs, bin}: { + inherit bin; + default = bin; + }); + devShells = forAllSystems({pkgs, bin}: pkgs.mkShell { + inputsFrom = bin; + }); + hydraJobs."build" = forAllSystems({pkgs, bin}: bin); + }; }