dotfiles/user-modules/development/language/rust.nix

57 lines
967 B
Nix
Raw Permalink Normal View History

2024-07-19 12:00:55 +00:00
{
lib,
config,
pkgs,
...
}:
2024-07-19 11:59:26 +00:00
with lib;
let
cfg = config.modules.rust;
2024-07-19 12:00:55 +00:00
in
{
2024-07-19 11:59:26 +00:00
options.modules.rust = {
enable = mkEnableOption "rust";
};
config = mkIf cfg.enable {
# Development packages
home.packages = with pkgs; [
2024-09-02 18:03:39 +00:00
rustup
# rustc
# cargo
gcc
2024-09-02 18:03:39 +00:00
lldb
2024-12-01 23:53:05 +00:00
bacon
2024-09-02 18:03:39 +00:00
# rust-analyzer
# rustfmt
# clippy
2024-07-19 11:59:26 +00:00
];
# VSCode configuration
programs.vscode = {
extensions = with pkgs.vscode-extensions; [
rust-lang.rust-analyzer
vadimcn.vscode-lldb
2024-09-02 18:03:39 +00:00
tamasfe.even-better-toml
serayuzgur.crates
];
2024-07-19 11:59:26 +00:00
userSettings = {
"[rust]" = {
"editor.inlayHints.enabled" = "off";
};
2024-09-02 18:03:39 +00:00
"rust-analyzer.check.command" = "clippy";
"rust-analyzer.showUnlinkedFileNotification" = false;
2024-07-19 11:59:26 +00:00
};
};
# Neovim configuration
programs.nixvim = {
2024-12-01 23:53:05 +00:00
plugins.rustaceanvim = {
2024-07-19 11:59:26 +00:00
enable = true;
};
};
};
2024-07-19 12:00:55 +00:00
}