From 33f7b7172cf5623942eefb215e7d9a440bf5dd3e Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 9 Feb 2022 17:10:33 +0100 Subject: pkgs/vim: Add rustfmt with custom default config Since I do have a lot of projects where I use rustfmt, it gets pretty tedious to manually run "cargo fmt". Using g:rustfmt_autosave should make this less tedious but it might annoy me in the future, let's see. In addition to setting rustfmt I also added a default path for rustc, which is used whenever there is no rustc in path. This is because I usually switch between several projects which use different Rust versions and this way it will use the rustc version that is in PATH during "nix develop". For the rustfmt part I also added a small default configuration which represents my opinion on how I think Rust code should be formatted. The file is used whenever a project doesn't have a "rustfmt.toml" or ".rustfmt.toml". Unfortunately, RustFmt is broken in Vim right now[1], so I'm using the upstream project until the issue has been resolved. [1]: https://github.com/rust-lang/rust.vim/issues/446 Signed-off-by: aszlig --- pkgs/aszlig/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkgs/aszlig/default.nix') diff --git a/pkgs/aszlig/default.nix b/pkgs/aszlig/default.nix index 58f372a9..0629ab8e 100644 --- a/pkgs/aszlig/default.nix +++ b/pkgs/aszlig/default.nix @@ -1,4 +1,4 @@ -{ callPackage, callPackage_i686, vim_configurable, gopass, mutt, xterm }: +{ callPackage, vim_configurable, gopass, mutt, xterm, rustfmt }: { aacolorize = callPackage ./aacolorize { }; @@ -12,6 +12,7 @@ nlast = callPackage ./nlast { }; psi = callPackage ./psi { }; pvolctrl = callPackage ./pvolctrl { }; + rustfmt = callPackage ./rustfmt { inherit rustfmt; }; vim = callPackage ./vim { vim = vim_configurable; }; xterm = callPackage ./xterm { inherit xterm; }; } -- cgit 1.4.1