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;
|
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 = {
|
programs.emacs.init.usePackage.rust-mode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
hook = [ ''(rust-mode . (lambda () (cargo-minor-mode)))'' ]
|
hook = [ ''(rust-mode . (lambda () (cargo-minor-mode)))'' ]
|
||||||
|
@ -15,7 +20,7 @@ mkIf (elem "emacs::rust" config.machine.pkgs) {
|
||||||
"<tab>" = "company-indent-or-complete-common";
|
"<tab>" = "company-indent-or-complete-common";
|
||||||
};};
|
};};
|
||||||
config = ''
|
config = ''
|
||||||
(setq rust-rustfmt-bin "${pkgs.rustfmt}/bin/rustfmt")
|
(setq rust-rustfmt-bin "${rustEnv}/bin/rustfmt")
|
||||||
(setq rust-format-on-save t)
|
(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)))'';
|
] ++ optional (elem "emacs::company" config.machine.pkgs) ''(racer-mode . (lambda () (company-mode)))'';
|
||||||
|
|
||||||
config = ''
|
config = ''
|
||||||
(setq racer-rust-src-path (concat (getenv "HOME")
|
(setq racer-rust-src-path "${rustEnv}/lib/rustlib/src/rust/src")
|
||||||
"/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/"))
|
(setq racer-cmd "${rustEnv}/bin/racer")
|
||||||
(setq racer-cmd "${pkgs.rustracer}/bin/racer")
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue