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, ... }:
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"
])
];
};
}
);
};
}