diff --git a/flake.lock b/flake.lock index e46f50e..fb491e0 100644 --- a/flake.lock +++ b/flake.lock @@ -18,7 +18,28 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722305989, + "narHash": "sha256-ljiuTGSFuEtudqFqp/5Wr1OuEsVCjur/F2CmlNujSjc=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "38c2f156fca1868c8be7195ddac150522752f6ab", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index ff09b61..c47acf5 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: { default = import ./shell.nix { inherit pkgs; }; }); + }; }