Compare commits
4 Commits
c540d91464
...
31cc10fe03
Author | SHA1 | Date | |
---|---|---|---|
31cc10fe03 | |||
eecf89d736 | |||
bcd4398321 | |||
4f6d5d49e8 |
@ -15,6 +15,7 @@
|
|||||||
extraGroups = [
|
extraGroups = [
|
||||||
"wheel"
|
"wheel"
|
||||||
"keyd"
|
"keyd"
|
||||||
|
"systemd-journal"
|
||||||
(lib.mkIf config.virtualisation.docker.enable "docker")
|
(lib.mkIf config.virtualisation.docker.enable "docker")
|
||||||
(lib.mkIf config.virtualisation.libvirtd.enable "libvirtd")
|
(lib.mkIf config.virtualisation.libvirtd.enable "libvirtd")
|
||||||
(lib.mkIf config.programs.wireshark.enable "wireshark")
|
(lib.mkIf config.programs.wireshark.enable "wireshark")
|
||||||
@ -42,4 +43,4 @@
|
|||||||
files = [ ".bash_history" ];
|
files = [ ".bash_history" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -9,6 +9,11 @@
|
|||||||
CARGO_HOME = "${config.xdg.dataHome}/cargo";
|
CARGO_HOME = "${config.xdg.dataHome}/cargo";
|
||||||
RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
|
RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
|
||||||
RUST_SRC_PATH = "${pkgs.fenix.complete.rust-src}/lib/rustlib/src/rust/library";
|
RUST_SRC_PATH = "${pkgs.fenix.complete.rust-src}/lib/rustlib/src/rust/library";
|
||||||
|
# HACK: Specify openssl info for rust, this is really not a good idea, but it saves me from
|
||||||
|
# writing per-project shell.nix or `nix-shell -p` nonsense. I'm willing to compromise for my
|
||||||
|
# laziness.
|
||||||
|
OPENSSL_DIR = "${pkgs.openssl.dev}";
|
||||||
|
OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib";
|
||||||
};
|
};
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
(pkgs.fenix.complete.withComponents [
|
(pkgs.fenix.complete.withComponents [
|
||||||
@ -21,7 +26,17 @@
|
|||||||
rust-analyzer-nightly
|
rust-analyzer-nightly
|
||||||
cargo-watch
|
cargo-watch
|
||||||
cargo-nextest
|
cargo-nextest
|
||||||
|
sccache
|
||||||
];
|
];
|
||||||
|
file = {
|
||||||
|
# NOTE: This improves the rust edit-build-run cycle. See https://davidlattimore.github.io/posts/2024/02/04/speeding-up-the-rust-edit-build-run-cycle.html
|
||||||
|
"${config.home.sessionVariables.CARGO_HOME}/config.toml".text = ''
|
||||||
|
[build]
|
||||||
|
rustflags = [ "-C", "linker=${pkgs.clang}/bin/clang", "-C", "link-arg=--ld-path=${pkgs.mold-wrapped}/bin/mold" ]
|
||||||
|
|
||||||
|
[profile.dev]
|
||||||
|
split-debuginfo = "unpacked"
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mrcjkb/rustaceanvim",
|
"mrcjkb/rustaceanvim",
|
||||||
ft = { "rust" },
|
lazy = false,
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.rustaceanvim = {
|
vim.g.rustaceanvim = {
|
||||||
dap = {
|
dap = {
|
||||||
@ -110,13 +110,7 @@ return {
|
|||||||
default_settings = {
|
default_settings = {
|
||||||
["rust-analyzer"] = {
|
["rust-analyzer"] = {
|
||||||
cargo = {
|
cargo = {
|
||||||
features = "all",
|
targetDir = "target/rust-analyzer/",
|
||||||
loadOutDirsFromCheck = true,
|
|
||||||
runBuildScripts = true,
|
|
||||||
},
|
|
||||||
check = {
|
|
||||||
command = "clippy",
|
|
||||||
features = "all",
|
|
||||||
},
|
},
|
||||||
checkOnSave = true,
|
checkOnSave = true,
|
||||||
rustfmt = {
|
rustfmt = {
|
||||||
|
@ -39,8 +39,8 @@ local map_quick_close = function(bufnr)
|
|||||||
pcall(vim.keymap.del, "n", lhs)
|
pcall(vim.keymap.del, "n", lhs)
|
||||||
end)
|
end)
|
||||||
vim.keymap.set("n", "q", function()
|
vim.keymap.set("n", "q", function()
|
||||||
bwdelete({ buf = bufnr, force = true })
|
vim.cmd.bdelete({ args = { bufnr }, bang = true })
|
||||||
end, { silent = true, buffer = bufnr, desc = "Close Terminal Buffer" })
|
end, { silent = true, buffer = bufnr, desc = "Quick Close Buffer" })
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "TermOpen" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "TermOpen" }, {
|
||||||
|
Loading…
Reference in New Issue
Block a user