From a96bf2ad367d8cd47200b69456122c4e3191a11b Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 19 Dec 2023 10:41:50 -0600 Subject: [PATCH] Fix rust flake template --- templates/rust/flake.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/templates/rust/flake.nix b/templates/rust/flake.nix index fbede70..f3d957a 100644 --- a/templates/rust/flake.nix +++ b/templates/rust/flake.nix @@ -4,19 +4,14 @@ self, nixpkgs, }: let + inherit (self) outputs; supportedSystems = ["x86_64-linux"]; - forEachSupportedSystem = f: - nixpkgs.lib.genAttrs supportedSystems (system: - f { - inherit system; - pkgs = import nixpkgs {inherit system;}; - }); + forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems; in { - devShells = forEachSupportedSystem ({ - pkgs, - system, - }: { - rust-development = pkgs.mkShell { + devShells = forEachSupportedSystem (system: let + pkgs = import nixpkgs {inherit system;}; + in { + rust-dev = pkgs.mkShell { buildInputs = with pkgs; [ cargo rustc @@ -26,7 +21,7 @@ ]; }; - default = forEachSupportedSystem ({system, ...}: self.outputs.${system}.rust-development); + default = outputs.devShells.${system}.rust-dev; }); }; }