pkgsets/emacs/rust: use rust overlay from pkgsets
This commit is contained in:
parent
f0202c96d9
commit
5c266bc532
1 changed files with 9 additions and 5 deletions
|
@ -2,7 +2,12 @@
|
|||
|
||||
with lib;
|
||||
|
||||
mkIf (elem "emacs::rust" config.machine.pkgs) {
|
||||
let
|
||||
rustEnv = pkgs.symlinkJoin {
|
||||
name = "rustEnv";
|
||||
paths = config.machine.pkgsets.rustpkgs.pkgwrap;
|
||||
};
|
||||
in mkIf (elem "emacs::rust" config.machine.pkgs) {
|
||||
programs.emacs.init.usePackage.rust-mode = {
|
||||
enable = true;
|
||||
hook = [ ''(rust-mode . (lambda () (cargo-minor-mode)))'' ]
|
||||
|
@ -15,7 +20,7 @@ mkIf (elem "emacs::rust" config.machine.pkgs) {
|
|||
"<tab>" = "company-indent-or-complete-common";
|
||||
};};
|
||||
config = ''
|
||||
(setq rust-rustfmt-bin "${pkgs.rustfmt}/bin/rustfmt")
|
||||
(setq rust-rustfmt-bin "${rustEnv}/bin/rustfmt")
|
||||
(setq rust-format-on-save t)
|
||||
'';
|
||||
};
|
||||
|
@ -33,9 +38,8 @@ mkIf (elem "emacs::rust" config.machine.pkgs) {
|
|||
] ++ optional (elem "emacs::company" config.machine.pkgs) ''(racer-mode . (lambda () (company-mode)))'';
|
||||
|
||||
config = ''
|
||||
(setq racer-rust-src-path (concat (getenv "HOME")
|
||||
"/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/"))
|
||||
(setq racer-cmd "${pkgs.rustracer}/bin/racer")
|
||||
(setq racer-rust-src-path "${rustEnv}/lib/rustlib/src/rust/src")
|
||||
(setq racer-cmd "${rustEnv}/bin/racer")
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue