refactor: flake.nix

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

View File

@@ -6,27 +6,26 @@
}; };
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
packages = with pkgs; [ {
zsh default = pkgs.mkShell {
(fenix.packages.${system}.complete.withComponents [ packages = with pkgs; [
"cargo" zsh
"clippy" (fenix.packages.${system}.complete.withComponents [
"rust-src" "cargo"
"rustc" "clippy"
"rustfmt" "rust-src"
"rust-analyzer" "rustc"
]) "rustfmt"
]; "rust-analyzer"
shellHook = '' ])
zsh & disown ];
exit };
''; }
}; );
}; };
} }