refactor: flake.nix

This commit is contained in:
2025-05-03 16:46:41 +08:00
parent f78c516d17
commit 030c61df52

View File

@@ -6,12 +6,13 @@
}; };
outputs = { nixpkgs, fenix, ... }: outputs = { nixpkgs, fenix, ... }:
let let
system = "x86_64-linux"; forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
pkgs = import nixpkgs { inherit system; };
in in
{ {
formatter.${system} = pkgs.nixpkgs-fmt; devShells = forAllSystems (system:
devShells.${system}.default = pkgs.mkShell { let pkgs = import nixpkgs { inherit system; }; in
{
default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
zsh zsh
(fenix.packages.${system}.complete.withComponents [ (fenix.packages.${system}.complete.withComponents [
@@ -23,10 +24,8 @@
"rust-analyzer" "rust-analyzer"
]) ])
]; ];
shellHook = '' };
zsh & disown }
exit );
'';
};
}; };
} }