aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2024-11-02 11:17:38 +0200
committerZhongheng Liu <z.liu@outlook.com.gr>2024-11-02 11:17:38 +0200
commita641d4fafea93316430f175b66c653ad811c1437 (patch)
tree8ad81df69d401ccb3afaf67e6c78625bbca65b8b
parent3c9a9d42cf52bc5aa3a6f6e09f42ce1590cc40bf (diff)
downloadnixos-configuration-a641d4fafea93316430f175b66c653ad811c1437.tar.gz
nixos-configuration-a641d4fafea93316430f175b66c653ad811c1437.tar.bz2
nixos-configuration-a641d4fafea93316430f175b66c653ad811c1437.zip
feat: add rust error explanation binding
-rw-r--r--home-manager/stvnliu/nixvim/custom/binds.nix8
-rw-r--r--home-manager/stvnliu/nixvim/default.nix232
-rw-r--r--nixos/configuration.nix1
-rw-r--r--nixos/ly.nix9
4 files changed, 135 insertions, 115 deletions
diff --git a/home-manager/stvnliu/nixvim/custom/binds.nix b/home-manager/stvnliu/nixvim/custom/binds.nix
new file mode 100644
index 0000000..63e9262
--- /dev/null
+++ b/home-manager/stvnliu/nixvim/custom/binds.nix
@@ -0,0 +1,8 @@
+[
+ {
+ mode = "n";
+ key = "<leader>ree";
+ action = "<CMD>RustLsp explainError<CR>";
+ options.desc = "Explain this Rust error (custom)";
+ }
+]
diff --git a/home-manager/stvnliu/nixvim/default.nix b/home-manager/stvnliu/nixvim/default.nix
index 4373b54..afe1179 100644
--- a/home-manager/stvnliu/nixvim/default.nix
+++ b/home-manager/stvnliu/nixvim/default.nix
@@ -26,125 +26,127 @@
defaultEditor = true;
globals.mapleader = " ";
colorschemes.gruvbox = {enable = true;};
- keymaps = [
- # Global
- # Default mode is "" which means normal-visual-op
- {
- mode = "n";
- key = "<leader>bg";
- action = "<CMD>TransparentToggle<CR>";
- options.desc = "Toggle background transparency";
- }
- {
- key = "<C-n>";
- action = "<CMD>NvimTreeToggle<CR>";
- options.desc = "Toggle NvimTree";
- }
+ keymaps =
+ [
+ # Global
+ # Default mode is "" which means normal-visual-op
+ {
+ mode = "n";
+ key = "<leader>bg";
+ action = "<CMD>TransparentToggle<CR>";
+ options.desc = "Toggle background transparency";
+ }
+ {
+ key = "<C-n>";
+ action = "<CMD>NvimTreeToggle<CR>";
+ options.desc = "Toggle NvimTree";
+ }
- # File
- {
- mode = "n";
- key = "<leader>f";
- action = "+find/file";
- }
- {
- # Format file
- key = "<leader>fm";
- action = "<CMD>lua vim.lsp.buf.format()<CR>";
- options.desc = "Format the current buffer";
- }
+ # File
+ {
+ mode = "n";
+ key = "<leader>f";
+ action = "+find/file";
+ }
+ {
+ # Format file
+ key = "<leader>fm";
+ action = "<CMD>lua vim.lsp.buf.format()<CR>";
+ options.desc = "Format the current buffer";
+ }
- # Git
- {
- mode = "n";
- key = "<leader>g";
- action = "+git";
- }
- {
- mode = "n";
- key = "<leader>gt";
- action = "+toggles";
- }
- {
- key = "<leader>gtb";
- action = "<CMD>Gitsigns toggle_current_line_blame<CR>";
- options.desc = "Gitsigns current line blame";
- }
- {
- key = "<leader>gtd";
- action = "<CMD>Gitsigns toggle_deleted";
- options.desc = "Gitsigns deleted";
- }
- {
- key = "<leader>gd";
- action = "<CMD>Gitsigns diffthis<CR>";
- options.desc = "Gitsigns diff this buffer";
- }
+ # Git
+ {
+ mode = "n";
+ key = "<leader>g";
+ action = "+git";
+ }
+ {
+ mode = "n";
+ key = "<leader>gt";
+ action = "+toggles";
+ }
+ {
+ key = "<leader>gtb";
+ action = "<CMD>Gitsigns toggle_current_line_blame<CR>";
+ options.desc = "Gitsigns current line blame";
+ }
+ {
+ key = "<leader>gtd";
+ action = "<CMD>Gitsigns toggle_deleted";
+ options.desc = "Gitsigns deleted";
+ }
+ {
+ key = "<leader>gd";
+ action = "<CMD>Gitsigns diffthis<CR>";
+ options.desc = "Gitsigns diff this buffer";
+ }
- # Tabs
- {
- mode = "n";
- key = "<leader>t";
- action = "+tab";
- }
- {
- mode = "n";
- key = "<leader>tn";
- action = "<CMD>tabnew<CR>";
- options.desc = "Create new tab";
- }
- {
- mode = "n";
- key = "<leader>td";
- action = "<CMD>tabclose<CR>";
- options.desc = "Close tab";
- }
- {
- mode = "n";
- key = "<leader>ts";
- action = "<CMD>tabnext<CR>";
- options.desc = "Go to the sub-sequent tab";
- }
- {
- mode = "n";
- key = "<leader>tp";
- action = "<CMD>tabprevious<CR>";
- options.desc = "Go to the previous tab";
- }
+ # Tabs
+ {
+ mode = "n";
+ key = "<leader>t";
+ action = "+tab";
+ }
+ {
+ mode = "n";
+ key = "<leader>tn";
+ action = "<CMD>tabnew<CR>";
+ options.desc = "Create new tab";
+ }
+ {
+ mode = "n";
+ key = "<leader>td";
+ action = "<CMD>tabclose<CR>";
+ options.desc = "Close tab";
+ }
+ {
+ mode = "n";
+ key = "<leader>ts";
+ action = "<CMD>tabnext<CR>";
+ options.desc = "Go to the sub-sequent tab";
+ }
+ {
+ mode = "n";
+ key = "<leader>tp";
+ action = "<CMD>tabprevious<CR>";
+ options.desc = "Go to the previous tab";
+ }
- # Terminal
- {
- # Escape terminal mode using ESC
- mode = "t";
- key = "<esc>";
- action = "<C-\\><C-n>";
- options.desc = "Escape terminal mode";
- }
+ # Terminal
+ {
+ # Escape terminal mode using ESC
+ mode = "t";
+ key = "<esc>";
+ action = "<C-\\><C-n>";
+ options.desc = "Escape terminal mode";
+ }
- # Trouble
- {
- mode = "n";
- key = "<leader>d";
- action = "+diagnostics/debug";
- }
- {
- key = "<leader>dt";
- action = "<CMD>TroubleToggle<CR>";
- options.desc = "Toggle trouble";
- }
+ # Trouble
+ {
+ mode = "n";
+ key = "<leader>d";
+ action = "+diagnostics/debug";
+ }
+ {
+ key = "<leader>dt";
+ action = "<CMD>TroubleToggle<CR>";
+ options.desc = "Toggle trouble";
+ }
- # Rust
- {
- mode = "n";
- key = "<leader>r";
- action = "+rust";
- }
- {
- # Start standalone rust-analyzer (fixes issues when opening files from nvim tree)
- mode = "n";
- key = "<leader>rs";
- action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
- options.desc = "Start standalone rust-analyzer";
- }
- ];
+ # Rust
+ {
+ mode = "n";
+ key = "<leader>r";
+ action = "+rust";
+ }
+ {
+ # Start standalone rust-analyzer (fixes issues when opening files from nvim tree)
+ mode = "n";
+ key = "<leader>rs";
+ action = "<CMD>RustStartStandaloneServerForBuffer<CR>";
+ options.desc = "Start standalone rust-analyzer";
+ }
+ ]
+ ++ (import ./custom/binds.nix);
}
diff --git a/nixos/configuration.nix b/nixos/configuration.nix
index d4c1dff..82cd0bc 100644
--- a/nixos/configuration.nix
+++ b/nixos/configuration.nix
@@ -10,6 +10,7 @@
imports = [
../common/variables.nix
./greetd.nix
+ #./ly.nix
./bootloader.nix
./nvidia.nix
./fonts.nix
diff --git a/nixos/ly.nix b/nixos/ly.nix
new file mode 100644
index 0000000..20482d0
--- /dev/null
+++ b/nixos/ly.nix
@@ -0,0 +1,9 @@
+{
+ pkgs,
+ config,
+ ...
+}: {
+ services.displayManager.ly = {
+ enable = true;
+ };
+}