feat: rework to modular
This commit is contained in:
24
shells/rust.nix
Normal file
24
shells/rust.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
extraPackages ? [ ],
|
||||
inputsFrom ? [ ],
|
||||
shellHook ? "",
|
||||
}:
|
||||
let
|
||||
optionalPackage = path: lib.attrByPath path null pkgs;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
inherit inputsFrom shellHook;
|
||||
|
||||
packages = builtins.filter (pkg: pkg != null) (
|
||||
[
|
||||
pkgs.cargo
|
||||
pkgs.rustc
|
||||
(optionalPackage [ "rust-analyzer" ])
|
||||
(optionalPackage [ "rustfmt" ])
|
||||
(optionalPackage [ "clippy" ])
|
||||
]
|
||||
++ extraPackages
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user