diff --git a/flake.nix b/flake.nix index 1cfffd9..17003a8 100644 --- a/flake.nix +++ b/flake.nix @@ -6,27 +6,26 @@ }; outputs = { nixpkgs, fenix, ... }: let - system = "x86_64-linux"; - pkgs = import nixpkgs { inherit system; }; + forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; in { - formatter.${system} = pkgs.nixpkgs-fmt; - devShells.${system}.default = pkgs.mkShell { - packages = with pkgs; [ - zsh - (fenix.packages.${system}.complete.withComponents [ - "cargo" - "clippy" - "rust-src" - "rustc" - "rustfmt" - "rust-analyzer" - ]) - ]; - shellHook = '' - zsh & disown - exit - ''; - }; + devShells = forAllSystems (system: + let pkgs = import nixpkgs { inherit system; }; in + { + default = pkgs.mkShell { + packages = with pkgs; [ + zsh + (fenix.packages.${system}.complete.withComponents [ + "cargo" + "clippy" + "rust-src" + "rustc" + "rustfmt" + "rust-analyzer" + ]) + ]; + }; + } + ); }; }