From ca9aec6e644e96c90b310565055f93f97d2a38cd Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Mon, 29 Jul 2024 22:38:22 -0700 Subject: [PATCH] nix: use rustoverlay; thanks nullcube <3 --- flake.nix | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) 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; }); + }; }