diff --git a/flake.nix b/flake.nix index ff09b61..1dfc530 100644 --- a/flake.nix +++ b/flake.nix @@ -3,9 +3,27 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs }: { - devShells.x86_64-linux.default = import ./shell.nix { pkgs = nixpkgs.legacyPackages.x86_64-linux; }; - }; + outputs = { nixpkgs, rust-overlay, ... }: + let + # System types to support. + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + forAllSystems = function: nixpkgs.lib.genAttrs supportedSystems + (system: function (import nixpkgs { + inherit system; + overlays = [ rust-overlay.overlays.default ]; + })); + in + { + devShells = forAllSystems (pkgs: import ./shell.nix { inherit pkgs; }); + }; }