From d554c8fbf2478a4844f641e816a77ded71bfb1ef Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 16 May 2024 15:52:35 -0400 Subject: [PATCH 01/33] fix(hyprland): use correct cursor theme in all apps --- user/modules/hyprland.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/user/modules/hyprland.nix b/user/modules/hyprland.nix index 6e525a9..2903777 100644 --- a/user/modules/hyprland.nix +++ b/user/modules/hyprland.nix @@ -1,7 +1,7 @@ {pkgs, ...}: { imports = [ ./waybar - ./wofi + ./wofi.nix ]; home.packages = with pkgs; [ @@ -95,10 +95,12 @@ name = "Papirus"; package = pkgs.papirus-icon-theme; }; - cursorTheme = { - name = "Adwaita"; - package = pkgs.gnome.adwaita-icon-theme; - size = 24; - }; + }; + + home.pointerCursor = { + gtk.enable = true; + name = "Adwaita"; + package = pkgs.gnome.adwaita-icon-theme; + size = 24; }; } From 809f3267e14b3f1b8893a0c34f36fe8a0909b03b Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 16 May 2024 15:52:56 -0400 Subject: [PATCH 02/33] fix(hyprland): match mesa version to hyprland version --- modules/hyprland.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/hyprland.nix b/modules/hyprland.nix index 0a3243c..c40980d 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -4,6 +4,11 @@ package = pkgs.unstable.hyprland; }; + hardware.opengl = { + package = pkgs.unstable.mesa.drivers; + package32 = pkgs.unstable.pkgsi686Linux.mesa.drivers; + }; + services.gnome.gnome-keyring.enable = true; environment.systemPackages = with pkgs; [ From daeb06b7a2ff0329201e5e17ac0a57e7fa2307f7 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 16 May 2024 15:53:34 -0400 Subject: [PATCH 03/33] feat(hyprland): move to tuigreet --- modules/hyprland.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/hyprland.nix b/modules/hyprland.nix index c40980d..4b7d116 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -10,15 +10,12 @@ }; services.gnome.gnome-keyring.enable = true; + security.pam.services.greetd.enableGnomeKeyring = true; environment.systemPackages = with pkgs; [ # Theme adw-gtk3 - # Greeter - cage - greetd.gtkgreet - # Applications gnome.nautilus gnome.sushi @@ -42,7 +39,8 @@ enable = true; settings = { default_session = { - command = "cage -s -- gtkgreet --command=Hyprland"; + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland"; + user = "greeter"; }; }; }; From 62b7e887099a50c14bb3e546f712a51851f9ae38 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 16 May 2024 15:53:43 -0400 Subject: [PATCH 04/33] feat(hyprland): add keyd config --- modules/hyprland.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/hyprland.nix b/modules/hyprland.nix index 4b7d116..a8ed061 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -35,6 +35,17 @@ # Required for Nautilus to work outside GNOME services.gvfs.enable = true; + # Use CAPSLOCK as Hyper key + services.keyd = { + enable = true; + keyboards.default = { + ids = ["*"]; + settings.main = { + capslock = "overload(meta, esc)"; + }; + }; + }; + services.greetd = { enable = true; settings = { From 7b20ca3586fe6ea81e8397b4be604aec88df9a0d Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 16 May 2024 15:53:52 -0400 Subject: [PATCH 05/33] feat(nixos): add zellij module --- user/environments/nixos/home.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/user/environments/nixos/home.nix b/user/environments/nixos/home.nix index f31706a..49c5c92 100644 --- a/user/environments/nixos/home.nix +++ b/user/environments/nixos/home.nix @@ -9,6 +9,7 @@ ../../modules/hyprland.nix ../../modules/nvim.nix ../../modules/vscode.nix + ../../modules/zellij ../../modules/zsh.nix ]; From 678563cffec276dd1a89f62a273306287199d2c1 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 16 May 2024 15:54:07 -0400 Subject: [PATCH 06/33] chore(firefox): update firefox-gnome-theme --- user/modules/firefox.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user/modules/firefox.nix b/user/modules/firefox.nix index e06cb6d..b98aa26 100644 --- a/user/modules/firefox.nix +++ b/user/modules/firefox.nix @@ -5,8 +5,8 @@ source = pkgs.fetchFromGitHub { owner = "rafaelmardojai"; repo = "firefox-gnome-theme"; - rev = "v121"; - hash = "sha256-M+Cw6vh7xCDmIhyVuEPNmaNVUwpmdFQq8zlsXZTKees="; + rev = "v125"; + hash = "sha256-N1BmvredC7xfZhobNOog0+0KrbGXPbQmmmWHT1eOoBw="; }; }; From f09894d0dc4f71838d12845031f5e4eeadbb7568 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 30 May 2024 08:21:16 -0400 Subject: [PATCH 07/33] fix(forgejo): add caddy error message --- modules/services/forgejo/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/services/forgejo/default.nix b/modules/services/forgejo/default.nix index aa785b6..67241b0 100644 --- a/modules/services/forgejo/default.nix +++ b/modules/services/forgejo/default.nix @@ -89,6 +89,11 @@ in { }) (mkIf cfg.proxy { services.caddy.virtualHosts."${forgejoDomain}".extraConfig = '' + handle_errors { + status 502 + respond "This server is currently unavailable." + } + redir /user/login /user/oauth2/Keycloak?{query} reverse_proxy http://${proxyIP}:${toString cfg.port} From 0bb07cba5a5a7651bc2184f52ec1508df7e2b072 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 11:43:54 -0400 Subject: [PATCH 08/33] feat(ironbar): add module --- user/modules/ironbar/default.nix | 80 ++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 user/modules/ironbar/default.nix diff --git a/user/modules/ironbar/default.nix b/user/modules/ironbar/default.nix new file mode 100644 index 0000000..4304611 --- /dev/null +++ b/user/modules/ironbar/default.nix @@ -0,0 +1,80 @@ +{ + inputs, + lib, + ... +}: { + imports = [ + inputs.ironbar.homeManagerModules.default + ]; + + programs.ironbar = { + enable = true; + config = { + "anchor_to_edges" = true; + position = "top"; + start = [ + { + "type" = "workspaces"; + "all_monitors" = false; + # "name_map" = { + # "1" = "󰙯"; + # "2" = "icon:firefox"; + # "3" = ""; + # "Games" = "icon:steam"; + # "Code" = ""; + # }; + favorites = map (x: toString x) (lib.lists.range 1 8); + } + ]; + center = [ + { + type = "clock"; + } + ]; + end = [ + { + type = "volume"; + format = "{icon}"; + max_volume = 100; + icons = { + volume_high = "󰕾"; + volume_medium = "󰖀"; + volume_low = "󰕿"; + muted = "󰝟"; + }; + } + { + type = "notifications"; + show_count = true; + icons = { + closed_none = "󰍥"; + closed_some = "󱥂"; + closed_dnd = "󱅯"; + open_none = "󰍡"; + open_some = "󱥁"; + open_dnd = "󱅮"; + }; + } + ]; + }; + style = ""; + # package = inputs.ironbar; + systemd = false; + }; + + systemd.user.services.ironbar = { + Unit = { + Description = "Systemd service for Ironbar"; + Requires = ["graphical-session.target"]; + }; + + Service = { + Type = "simple"; + ExecStart = "${inputs.ironbar}/bin/ironbar"; + }; + + Install.WantedBy = [ + "hyprland-session.target" + ]; + }; +} From 780ef66712ecf551307a1037484091dede01d8ee Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 11:44:08 -0400 Subject: [PATCH 09/33] fix(nvim): add prettier as css formatter --- user/modules/nvim/lua/plugins/lsp.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/user/modules/nvim/lua/plugins/lsp.lua b/user/modules/nvim/lua/plugins/lsp.lua index dde9307..abc83d6 100644 --- a/user/modules/nvim/lua/plugins/lsp.lua +++ b/user/modules/nvim/lua/plugins/lsp.lua @@ -58,6 +58,7 @@ return { typescript = { { "prettierd", "prettier" } }, typescriptreact = { { "prettierd", "prettier" } }, yaml = { { "prettierd", "prettier" } }, + css = { { "prettierd", "prettier" } }, }, }, }, From f4c8294ded05bbea027c6266102a8571b11680e0 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 11:46:47 -0400 Subject: [PATCH 10/33] refactor: use shared module for home environments --- flake.lock | 427 ++++++++++++++++++++++++++++++++++++++++++++++------- flake.nix | 38 +++-- 2 files changed, 393 insertions(+), 72 deletions(-) diff --git a/flake.lock b/flake.lock index 6bf3bb0..2ab7563 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1715101957, - "narHash": "sha256-fs5uVQFTfgb4L9pnhldeyTHNcYwn1U4nKYoCBJ6W3W4=", + "lastModified": 1715290355, + "narHash": "sha256-2T7CHTqBXJJ3ZC6R/4TXTcKoXWHcvubKNj9SfomURnw=", "owner": "ryantm", "repo": "agenix", - "rev": "07479c2e7396acaaaac5925483498154034ea80a", + "rev": "8d37c5bdeade12b6479c85acd133063ab53187a0", "type": "github" }, "original": { @@ -23,6 +23,27 @@ "type": "github" } }, + "crane": { + "inputs": { + "nixpkgs": [ + "ironbar", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713979152, + "narHash": "sha256-apdecPuh8SOQnkEET/kW/UcfjCRb8JbV5BKjoH+DcP4=", + "owner": "ipetkov", + "repo": "crane", + "rev": "a5eca68a2cf11adb32787fc141cddd29ac8eb79c", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -52,11 +73,11 @@ ] }, "locked": { - "lastModified": 1713946171, - "narHash": "sha256-lc75rgRQLdp4Dzogv5cfqOg6qYc5Rp83oedF2t0kDp8=", + "lastModified": 1715901937, + "narHash": "sha256-eMyvWP56ZOdraC2IOvZo0/RTDcrrsqJ0oJWDC76JTak=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "230a197063de9287128e2c68a7a4b0cd7d0b50a7", + "rev": "ffc01182f90118119930bdfc528c1ee9a39ecef8", "type": "github" }, "original": { @@ -100,14 +121,14 @@ }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -118,7 +139,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -136,7 +157,25 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "inputs": { + "systems": "systems_6" }, "locked": { "lastModified": 1705309234, @@ -152,9 +191,9 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_5": { "inputs": { - "systems": "systems_6" + "systems": "systems_8" }, "locked": { "lastModified": 1681202837, @@ -198,11 +237,11 @@ ] }, "locked": { - "lastModified": 1714043624, - "narHash": "sha256-Xn2r0Jv95TswvPlvamCC46wwNo8ALjRCMBJbGykdhcM=", + "lastModified": 1715381426, + "narHash": "sha256-wPuqrAQGdv3ISs74nJfGb+Yprm23U/rFpcHFFNWgM94=", "owner": "rycee", "repo": "home-manager", - "rev": "86853e31dc1b62c6eeed11c667e8cdd0285d4411", + "rev": "ab5542e9dbd13d0100f8baae2bc2d68af901f4b4", "type": "github" }, "original": { @@ -212,18 +251,190 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1715791817, + "narHash": "sha256-J069Uhv/gCMFLX1dSh2f+9ZTM09r1Nv3oUfocCnWKow=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "7c3aa03dffb53921e583ade3d4ae3f487e390e7e", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "hyprcursor": "hyprcursor", + "hyprlang": "hyprlang", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs", + "systems": "systems_2", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1715898843, + "narHash": "sha256-6m0pykL42d5DXLe6dy31dbE0VlgtTCT3WUqf6pIs3RE=", + "ref": "refs/heads/main", + "rev": "a66cfe0fbed7fb4dc69383e107c2bf3b1e7cd80a", + "revCount": 4709, + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "xdph", + "nixpkgs" + ], + "systems": [ + "hyprland", + "xdph", + "systems" + ] + }, + "locked": { + "lastModified": 1691753796, + "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1715791527, + "narHash": "sha256-HhQ4zvGHrRjR63ltySSeg+x+0jb0lepiutWdnFhLRoo=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "969cb076e5b76f2e823aeca1937a3e1f159812ee", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1715879663, + "narHash": "sha256-/DwglRvj4XF4ECdNtrCIbthleszAZBwOiXG5A6r0K/c=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "f5181a068c1b06f2db51f6222e50a0c665a2b0c3", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "ironbar": { + "inputs": { + "crane": "crane", + "naersk": "naersk", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1715799856, + "narHash": "sha256-PPEVVM95PbEkrD+9KEZGWZrlhPqKanPn717l/sdjQsE=", + "owner": "JakeStanger", + "repo": "ironbar", + "rev": "c641b368a5aac7c7fcf97f660b5ee820c724bcdc", + "type": "github" + }, + "original": { + "owner": "JakeStanger", + "repo": "ironbar", + "type": "github" + } + }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1713520724, + "narHash": "sha256-CO8MmVDmqZX2FovL75pu5BvwhW+Vugc7Q6ze7Hj8heI=", + "owner": "nix-community", + "repo": "naersk", + "rev": "c5037590290c6c7dae2e42e7da1e247e54ed2d49", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, "nix-vscode-extensions": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1715130616, - "narHash": "sha256-pWwzSphfGbeg/2lmfFo15b2Ykv/JtTXAWydy8dfHv9I=", + "lastModified": 1715822547, + "narHash": "sha256-2t+GMP23RRDfEel4YgaCb/qo6d432eJEFFM+4Rn+8b4=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "f0219364cbf407c76993996a9242b8eda0406b9a", + "rev": "6490ae7fc23e44b455766eb46a90257468596edd", "type": "github" }, "original": { @@ -235,17 +446,17 @@ "nixos-wsl": { "inputs": { "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1715114695, - "narHash": "sha256-Pw81Wkm8RhCZr17ltsDabFpat1lRltRAszkppBmmdaI=", + "lastModified": 1715888388, + "narHash": "sha256-aoO2kmvBeZ1ADKD5QZDu652IesI4aQ8eOgDFQm7DfA8=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "19c7ae9034389f5a7bbc6b17a7b72289c1c52272", + "rev": "d926f9ff6aa0cafe70b126b20d98086646c166ef", "type": "github" }, "original": { @@ -255,6 +466,36 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1715787315, + "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1714314149, + "narHash": "sha256-yNAevSKF4krRWacmLUsLK7D7PlfuY3zF0lYnGYNi9vQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cf8cc1201be8bc71b7cbbbdaf349b22f4f99c7ae", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1713805509, "narHash": "sha256-YgSEan4CcrjivCNO5ZNzhg7/8ViLkZ4CB/GrGBVSudo=", @@ -270,13 +511,13 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_4": { "locked": { - "lastModified": 1714971268, - "narHash": "sha256-IKwMSwHj9+ec660l+I4tki/1NRoeGpyA2GdtdYpAgEw=", + "lastModified": 1715668745, + "narHash": "sha256-xp62OkRkbUDNUc6VSqH02jB0FbOS+MsfMb7wL1RJOfA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "27c13997bf450a01219899f5a83bd6ffbfc70d3c", + "rev": "9ddcaffecdf098822d944d4147dd8da30b4e6843", "type": "github" }, "original": { @@ -285,7 +526,7 @@ "type": "indirect" } }, - "nixpkgs_3": { + "nixpkgs_5": { "locked": { "lastModified": 1706487304, "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", @@ -303,11 +544,11 @@ }, "nur": { "locked": { - "lastModified": 1715211950, - "narHash": "sha256-//YbMDEYB9O8ugYN1nsUQUhbBDFizhdnfHzkRIoc2MM=", + "lastModified": 1715899068, + "narHash": "sha256-dQn+Hv13ln+2d8rbIvGgYMLVGtcZLkghByu0yyRSoVc=", "owner": "nix-community", "repo": "NUR", - "rev": "6580e34800c76147aa5d61cf598123f0de72971c", + "rev": "f1c319a9df9a7d5b0282c3dbc2a0d3fce30270c8", "type": "github" }, "original": { @@ -321,11 +562,13 @@ "agenix": "agenix", "darwin": "darwin_2", "home-manager": "home-manager_2", + "hyprland": "hyprland", + "ironbar": "ironbar", "nix-vscode-extensions": "nix-vscode-extensions", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_4", "nur": "nur", - "rust-overlay": "rust-overlay", + "rust-overlay": "rust-overlay_2", "unstable": "unstable", "utils": "utils", "vscode-server": "vscode-server" @@ -333,15 +576,37 @@ }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_3" + "flake-utils": "flake-utils", + "nixpkgs": [ + "ironbar", + "nixpkgs" + ] }, "locked": { - "lastModified": 1715134005, - "narHash": "sha256-oujsCgNiQnZoQntNkkNkA7BhCmUvf9FLWj+2oGT2Jvc=", + "lastModified": 1714443211, + "narHash": "sha256-lKTA3XqRo4aVgkyTSCtpcALpGXdmkilHTtN00eRg0QU=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "a8bfc2569a1965c0da8711d289d973f0011b441a", + "rev": "ce35c36f58f82cee6ec959e0d44c587d64281b6f", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1715825775, + "narHash": "sha256-7np2/EEr5Xm8IuKWQ43q8AA1Lb6Us2BW6rYMxGrInIg=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "55f468b3d49c5d3321e85f2f9b1158476a2a90fb", "type": "github" }, "original": { @@ -367,16 +632,16 @@ }, "systems_2": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -440,13 +705,43 @@ "type": "github" } }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "unstable": { "locked": { - "lastModified": 1715087517, - "narHash": "sha256-CLU5Tsg24Ke4+7sH8azHWXKd0CFd4mhLWfhYgUiDBpQ=", + "lastModified": 1715787315, + "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b211b392b8486ee79df6cdfb1157ad2133427a29", + "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", "type": "github" }, "original": { @@ -457,7 +752,7 @@ }, "utils": { "inputs": { - "systems": "systems_5" + "systems": "systems_7" }, "locked": { "lastModified": 1710146030, @@ -475,7 +770,7 @@ }, "vscode-server": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "nixpkgs": [ "nixpkgs" ] @@ -493,6 +788,36 @@ "repo": "nixos-vscode-server", "type": "github" } + }, + "xdph": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1715788457, + "narHash": "sha256-32HOkjSIyANphV0p5gIwP4ONU/CcinhwOyVFB+tL/d0=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "af7c87a32f5d67eb2ada908a6a700f4e74831943", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 04db89d..3074b99 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,11 @@ utils.url = "github:numtide/flake-utils"; rust-overlay.url = "github:oxalica/rust-overlay"; nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + ironbar = { + url = "github:JakeStanger/ironbar"; + inputs.nixpkgs.follows = "nixpkgs"; + }; agenix = { url = "github:ryantm/agenix"; @@ -72,7 +77,14 @@ nixpkgs.overlays = builtins.attrValues self.overlays; }; - nixosConfigurations = { + nixosConfigurations = let + homeModule = { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = {inherit inputs;}; + home-manager.users.michael = import ./user/environments/nixos/home.nix; + }; + in { kitchen = nixpkgs.lib.nixosSystem { system = utils.lib.system.x86_64-linux; modules = @@ -80,11 +92,7 @@ ++ [ ./modules/common.nix ./modules/containers.nix - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.michael = import ./user/environments/nixos/home.nix; - } + homeModule ./machines/kitchen/configuration.nix ]; @@ -99,11 +107,7 @@ ./modules/common.nix ./modules/hyprland.nix ./modules/containers.nix - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.michael = import ./user/environments/nixos/home.nix; - } + homeModule ./machines/thinkcentre/configuration.nix agenix.nixosModules.default @@ -125,11 +129,7 @@ ./modules/hyprland.nix ./modules/containers.nix ./modules/applications/steam - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.michael = import ./user/environments/nixos/home.nix; - } + homeModule ./machines/terra/configuration.nix agenix.nixosModules.default @@ -148,11 +148,7 @@ defaultModules ++ [ ./modules/nix.nix - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.michael = import ./user/environments/nixos-server/home.nix; - } + homeModule agenix.nixosModules.default { environment.systemPackages = [ From b4b50ab8ae1541e71e3fd79aed6310ba053dbcaa Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 11:47:20 -0400 Subject: [PATCH 11/33] chore(terra): format --- machines/terra/configuration.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/machines/terra/configuration.nix b/machines/terra/configuration.nix index c4f853c..6443617 100644 --- a/machines/terra/configuration.nix +++ b/machines/terra/configuration.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{pkgs, ...}: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -13,7 +9,7 @@ networking.firewall = { enable = true; }; - networking.networkmanager.enable=true; + networking.networkmanager.enable = true; # Set your time zone. time.timeZone = "America/New_York"; From 1bf2f497076e982444c902b13956f159d686365e Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 11:47:35 -0400 Subject: [PATCH 12/33] fix(terra): set nvim as default editor --- machines/terra/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/machines/terra/configuration.nix b/machines/terra/configuration.nix index 6443617..235dc01 100644 --- a/machines/terra/configuration.nix +++ b/machines/terra/configuration.nix @@ -45,6 +45,7 @@ }; programs.zsh.enable = true; + environment.variables.EDITOR = "nvim"; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.michael = { From 66b68354e0b78b83930e1f2de9a220efd4b91bee Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 11:48:05 -0400 Subject: [PATCH 13/33] feat(terra): add applications for hypermath development --- machines/terra/configuration.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/machines/terra/configuration.nix b/machines/terra/configuration.nix index 235dc01..b8cb976 100644 --- a/machines/terra/configuration.nix +++ b/machines/terra/configuration.nix @@ -51,7 +51,7 @@ users.users.michael = { isNormalUser = true; description = "Michael Thomas"; - extraGroups = ["wheel" "docker" "podman" "adbusers" "dialout"]; + extraGroups = ["wheel" "docker" "podman" "adbusers" "dialout" "libvirtd"]; shell = pkgs.zsh; openssh.authorizedKeys.keys = [ # Neptune @@ -61,6 +61,18 @@ ]; }; + # Enablle libvirtd + virtualisation.libvirtd.enable = true; + boot.kernelModules = ["kvm-amd" "kvm-intel"]; + + environment.systemPackages = with pkgs; [ + obs-studio + virt-manager + # GTK Discord Client + unstable.dissent + kdenlive + ]; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave From c6cc3d79b80416cf4a19e9cee75d69b9442b3b6e Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 11:48:35 -0400 Subject: [PATCH 14/33] fix(hyprland): support steam --- modules/applications/steam/default.nix | 3 ++- modules/hyprland.nix | 15 +++++++++++---- user/modules/hyprland.nix | 9 +++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/modules/applications/steam/default.nix b/modules/applications/steam/default.nix index cb00c75..01a2b5f 100644 --- a/modules/applications/steam/default.nix +++ b/modules/applications/steam/default.nix @@ -1,6 +1,7 @@ -{ +{pkgs, ...}: { programs.steam = { enable = true; + package = pkgs.unstable.steam; gamescopeSession.enable = true; }; } diff --git a/modules/hyprland.nix b/modules/hyprland.nix index a8ed061..b4d32fe 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -1,12 +1,19 @@ -{pkgs, ...}: { +{ + pkgs, + inputs, + ... +}: let + pkgs-hyprland = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; +in { programs.hyprland = { enable = true; - package = pkgs.unstable.hyprland; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; }; hardware.opengl = { - package = pkgs.unstable.mesa.drivers; - package32 = pkgs.unstable.pkgsi686Linux.mesa.drivers; + package = pkgs-hyprland.mesa.drivers; + driSupport32Bit = true; + package32 = pkgs-hyprland.pkgsi686Linux.mesa.drivers; }; services.gnome.gnome-keyring.enable = true; diff --git a/user/modules/hyprland.nix b/user/modules/hyprland.nix index 2903777..f9cfd24 100644 --- a/user/modules/hyprland.nix +++ b/user/modules/hyprland.nix @@ -1,6 +1,11 @@ -{pkgs, ...}: { +{ + pkgs, + inputs, + ... +}: { imports = [ ./waybar + inputs.hyprland.homeManagerModules.default ./wofi.nix ]; @@ -11,7 +16,7 @@ wayland.windowManager.hyprland = { enable = true; - package = pkgs.unstable.hyprland; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; settings = { "$mod" = "SUPER"; general = { From ece337586c7a3e3340099d9e3b8697390a830479 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 11:49:05 -0400 Subject: [PATCH 15/33] feat(hyprland): move to ironbar might ultimately move to ags, this is just a stopgap --- user/modules/hyprland.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/user/modules/hyprland.nix b/user/modules/hyprland.nix index f9cfd24..ec71db8 100644 --- a/user/modules/hyprland.nix +++ b/user/modules/hyprland.nix @@ -4,8 +4,9 @@ ... }: { imports = [ - ./waybar inputs.hyprland.homeManagerModules.default + # ./waybar + ./ironbar ./wofi.nix ]; From a9dc2f0f4b0b97c5ddaa86975dd82a75b8f041cb Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 11:49:42 -0400 Subject: [PATCH 16/33] chore(nvim): update lockfile --- user/modules/nvim/lazy-lock.json | 88 ++++++++++++++------------------ 1 file changed, 37 insertions(+), 51 deletions(-) diff --git a/user/modules/nvim/lazy-lock.json b/user/modules/nvim/lazy-lock.json index 2242f05..dc996a2 100644 --- a/user/modules/nvim/lazy-lock.json +++ b/user/modules/nvim/lazy-lock.json @@ -1,58 +1,44 @@ { - "LazyVim": { "branch": "main", "commit": "9b4675ddde38fdae09978bd7dbdba83ec91f4d80" }, - "LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" }, - "bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" }, - "catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" }, + "LazyVim": { "branch": "main", "commit": "b289fea1636eda08d82344dc32a114bca550e375" }, + "bufferline.nvim": { "branch": "main", "commit": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe" }, + "catppuccin": { "branch": "main", "commit": "5215ea59df6d0a7e27da9a5cd1165e06d1b04cbe" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "12b3995537f52ba2810a9857e8ca256881febbda" }, - "crates.nvim": { "branch": "main", "commit": "f00e11e8282b94f2a2e938d32712c99f0e0bdeb4" }, - "dashboard-nvim": { "branch": "master", "commit": "1c8b82c5b02bb890862538be2061e37ef801a99b" }, - "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, - "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, - "friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" }, - "gitsigns.nvim": { "branch": "main", "commit": "9cafac31a091267838e1e90fd6e083d37611f516" }, - "gruvbox.nvim": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" }, - "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, + "conform.nvim": { "branch": "master", "commit": "7159a23d19fb982269dae2e8147ebbe34965095b" }, + "dashboard-nvim": { "branch": "master", "commit": "7596101deb41192a4f7939d2c4f1a531a984b801" }, + "dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" }, + "flash.nvim": { "branch": "main", "commit": "0b85b5ea6eaaebab5e012fab3496102094550686" }, + "friendly-snippets": { "branch": "main", "commit": "e11b09bf10706bb74e16e4c3d11b2274d62e687f" }, + "gitsigns.nvim": { "branch": "main", "commit": "75dc649106827183547d3bedd4602442340d2f7f" }, + "gruvbox.nvim": { "branch": "main", "commit": "f99a08abc5ab0b9b5b0e7a33211a439155c60a61" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, + "lazy.nvim": { "branch": "main", "commit": "b0ba3f9399bf48c86abaa4db1a40bd0b681d5018" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, - "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "mini.ai": { "branch": "main", "commit": "55e9b7217f29e62f734e239bfeed5731a065d801" }, - "mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" }, - "mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" }, - "mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" }, - "mini.pairs": { "branch": "main", "commit": "5c975d8f68dc1e11bf4b20ced71e7987ed782513" }, - "mini.surround": { "branch": "main", "commit": "a00d69be09e3fe27dfa9e5b0298410d0e148e3e2" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, - "neoconf.nvim": { "branch": "main", "commit": "9aeec25740fd009594e63b34b1c0b67f8eb3adce" }, - "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, - "no-neck-pain.nvim": { "branch": "main", "commit": "34625be12649666b7ccb08761087cc97bb788552" }, - "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, - "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, - "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, - "nvim-lint": { "branch": "master", "commit": "861a04313501563bb1b11f125ae9b7237a517b9b" }, - "nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" }, - "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" }, - "nvim-treesitter": { "branch": "master", "commit": "bbc67f736e22c37c23f2c11a05bfa23b715af30c" }, - "nvim-treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, - "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, - "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, - "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, - "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, - "rustaceanvim": { "branch": "master", "commit": "cd35b0f7fb0c9fe6879b084096230a74fefa4da8" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, + "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, + "mini.ai": { "branch": "main", "commit": "7859b6344f5cee567a94f173859d25e20ba1a77e" }, + "mini.pairs": { "branch": "main", "commit": "40261dfcec7623cd57be3c3beb50fa73f2650cdf" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, + "no-neck-pain.nvim": { "branch": "main", "commit": "741ad26c4acc45f2164a3933f7825b0e555b724d" }, + "noice.nvim": { "branch": "main", "commit": "2bf04290b32dc5b1a002a4888c95147bb91ec6f2" }, + "nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" }, + "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, + "nvim-lint": { "branch": "master", "commit": "1a3a8d047bc01f1760ae4a0f5e80f111ea222e67" }, + "nvim-lspconfig": { "branch": "master", "commit": "74e14808cdb15e625449027019406e1ff6dda020" }, + "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, + "nvim-spectre": { "branch": "master", "commit": "4d22fe03554056de4325762add3e546c77e3a275" }, + "nvim-treesitter": { "branch": "master", "commit": "a80fe081b4c5890980561e0de2458f64aaffbfc7" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "fd41b7ccc5490a3a99c734d1ee418b68d06c48a9" }, + "nvim-ts-autotag": { "branch": "main", "commit": "6eb4120a1aadef07ac312f1c4bc6456712220007" }, + "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" }, + "persistence.nvim": { "branch": "main", "commit": "5fe077056c821aab41f87650bd6e1c48cd7dd047" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, - "telescope.nvim": { "branch": "master", "commit": "2d0d057791854decb2c9b6a0b52d43f3900dff40" }, - "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, - "tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" }, + "telescope.nvim": { "branch": "master", "commit": "dfa230be84a044e7f546a6c2b0a403c739732b86" }, + "todo-comments.nvim": { "branch": "main", "commit": "70a93ce66083699571adc361166504b03cc39c2b" }, + "tokyonight.nvim": { "branch": "main", "commit": "7e5ef71a103e7de5fe6c05f5d6ab97d1640f08cf" }, "tree-sitter-asm": { "branch": "main", "commit": "b0306e9bb2ebe01c6562f1aef265cc42ccc53070" }, - "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, - "vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" }, - "vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } + "trouble.nvim": { "branch": "main", "commit": "29d1bb81adc847e89ddbbf5b11ff0079daf7cc0a" }, + "which-key.nvim": { "branch": "main", "commit": "4b7167f8fb2dba3d01980735e3509e172c024c29" } } \ No newline at end of file From 9c9960d630777f8e240e4eab29170cc5da66257e Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 11:49:57 -0400 Subject: [PATCH 17/33] fix(git): add venus server as oauth provider --- user/modules/git_nixos.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/user/modules/git_nixos.nix b/user/modules/git_nixos.nix index 6c76c5f..bdfabd3 100644 --- a/user/modules/git_nixos.nix +++ b/user/modules/git_nixos.nix @@ -5,6 +5,7 @@ credential.helper = "manager"; credential.credentialStore = "secretservice"; credential."git.thomasfmly.org".provider = "generic"; + credential."https://git.s.michaelt.xyz".provider = "generic"; }; }; From febc9ee925beb5be64f8249b3d63cc851758467f Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 15:24:11 -0400 Subject: [PATCH 18/33] feat(nvim): disable rust extra, manually configure lsp --- user/modules/nvim/lazyvim.json | 2 +- user/modules/nvim/lua/config/lazy.lua | 3 ++- user/modules/nvim/lua/plugins/lsp.lua | 35 +++++++++++++++++++++------ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/user/modules/nvim/lazyvim.json b/user/modules/nvim/lazyvim.json index 971da55..f03853f 100644 --- a/user/modules/nvim/lazyvim.json +++ b/user/modules/nvim/lazyvim.json @@ -1,6 +1,6 @@ { "extras": [ - "lazyvim.plugins.extras.lang.rust" + ], "news": { "NEWS.md": "3314" diff --git a/user/modules/nvim/lua/config/lazy.lua b/user/modules/nvim/lua/config/lazy.lua index 6f29dbd..9b0516e 100644 --- a/user/modules/nvim/lua/config/lazy.lua +++ b/user/modules/nvim/lua/config/lazy.lua @@ -11,7 +11,8 @@ require("lazy").setup({ -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins", opts = { colorscheme = "gruvbox" } }, -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.lang.typescript" }, + -- { import = "lazyvim.plugins.extras.lang.rust" }, -- { import = "lazyvim.plugins.extras.lang.json" }, -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, -- import/override with your plugins diff --git a/user/modules/nvim/lua/plugins/lsp.lua b/user/modules/nvim/lua/plugins/lsp.lua index dde9307..64090b9 100644 --- a/user/modules/nvim/lua/plugins/lsp.lua +++ b/user/modules/nvim/lua/plugins/lsp.lua @@ -1,17 +1,30 @@ return { { "neovim/nvim-lspconfig", - ---@class PluginLspOpts opts = { - ---@type lspconfig.options - ---@diagnostic disable-next-line: missing-fields servers = { - ---@diagnostic disable-next-line: missing-fields - tsserver = {}, - ---@diagnostic disable-next-line: missing-fields - eslint = {}, - nil_ls = {}, + rust_analyzer = {}, + taplo = { + keys = { + { + "K", + function() + if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then + require("crates").show_popup() + else + vim.lsp.buf.hover() + end + end, + desc = "Show Crate Documentation", + }, + }, + }, }, + -- setup = { + -- rust_analyzer = function() + -- return true + -- end, + -- }, }, }, { @@ -64,4 +77,10 @@ return { { "rush-rs/tree-sitter-asm", }, + { + "imsnif/kdl.vim", + }, + { + "andreshazard/vim-freemarker", + }, } From a4947f9b71aa4c271093a30a4bf9f848840782b7 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 15:30:53 -0400 Subject: [PATCH 19/33] feat: upgrade to nixos 24.05 --- flake.lock | 126 +++++++++++++++---------------- flake.nix | 26 +++---- machines/terra/configuration.nix | 4 +- modules/avahi.nix | 2 +- user/modules/firefox.nix | 4 +- user/modules/zsh.nix | 9 +-- 6 files changed, 82 insertions(+), 89 deletions(-) diff --git a/flake.lock b/flake.lock index 2ab7563..66d9a01 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1715290355, - "narHash": "sha256-2T7CHTqBXJJ3ZC6R/4TXTcKoXWHcvubKNj9SfomURnw=", + "lastModified": 1716561646, + "narHash": "sha256-UIGtLO89RxKt7RF2iEgPikSdU53r6v/6WYB0RW3k89I=", "owner": "ryantm", "repo": "agenix", - "rev": "8d37c5bdeade12b6479c85acd133063ab53187a0", + "rev": "c2fc0762bbe8feb06a2e59a364fa81b3a57671c9", "type": "github" }, "original": { @@ -31,11 +31,11 @@ ] }, "locked": { - "lastModified": 1713979152, - "narHash": "sha256-apdecPuh8SOQnkEET/kW/UcfjCRb8JbV5BKjoH+DcP4=", + "lastModified": 1717025063, + "narHash": "sha256-dIubLa56W9sNNz0e8jGxrX3CAkPXsq7snuFA/Ie6dn8=", "owner": "ipetkov", "repo": "crane", - "rev": "a5eca68a2cf11adb32787fc141cddd29ac8eb79c", + "rev": "480dff0be03dac0e51a8dfc26e882b0d123a450e", "type": "github" }, "original": { @@ -73,11 +73,11 @@ ] }, "locked": { - "lastModified": 1715901937, - "narHash": "sha256-eMyvWP56ZOdraC2IOvZo0/RTDcrrsqJ0oJWDC76JTak=", + "lastModified": 1716993688, + "narHash": "sha256-vo5k2wQekfeoq/2aleQkBN41dQiQHNTniZeVONWiWLs=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "ffc01182f90118119930bdfc528c1ee9a39ecef8", + "rev": "c0d5b8c54d6828516c97f6be9f2d00c63a363df4", "type": "github" }, "original": { @@ -237,16 +237,16 @@ ] }, "locked": { - "lastModified": 1715381426, - "narHash": "sha256-wPuqrAQGdv3ISs74nJfGb+Yprm23U/rFpcHFFNWgM94=", + "lastModified": 1716736833, + "narHash": "sha256-rNObca6dm7Qs524O4st8VJH6pZ/Xe1gxl+Rx6mcWYo0=", "owner": "rycee", "repo": "home-manager", - "rev": "ab5542e9dbd13d0100f8baae2bc2d68af901f4b4", + "rev": "a631666f5ec18271e86a5cde998cba68c33d9ac6", "type": "github" }, "original": { "owner": "rycee", - "ref": "release-23.11", + "ref": "release-24.05", "repo": "home-manager", "type": "github" } @@ -267,11 +267,11 @@ ] }, "locked": { - "lastModified": 1715791817, - "narHash": "sha256-J069Uhv/gCMFLX1dSh2f+9ZTM09r1Nv3oUfocCnWKow=", + "lastModified": 1716576411, + "narHash": "sha256-FIN1wMoyePBTtibCbaeJaoKNLuAYIGwLCWAYC1DJanw=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "7c3aa03dffb53921e583ade3d4ae3f487e390e7e", + "rev": "57298fc4f13c807e50ada2c986a3114b7fc2e621", "type": "github" }, "original": { @@ -290,11 +290,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1715898843, - "narHash": "sha256-6m0pykL42d5DXLe6dy31dbE0VlgtTCT3WUqf6pIs3RE=", + "lastModified": 1717362715, + "narHash": "sha256-EnkKVUYqVfYqJso4t8ScuuMNEge7eybpdvtPCy4uwlc=", "ref": "refs/heads/main", - "rev": "a66cfe0fbed7fb4dc69383e107c2bf3b1e7cd80a", - "revCount": 4709, + "rev": "358e59e69d27a69381bc0872b5b8d1184bc6b6a1", + "revCount": 4756, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -344,11 +344,11 @@ ] }, "locked": { - "lastModified": 1715791527, - "narHash": "sha256-HhQ4zvGHrRjR63ltySSeg+x+0jb0lepiutWdnFhLRoo=", + "lastModified": 1716473782, + "narHash": "sha256-+qLn4lsHU6iL3+HTo1gTQ1tWzet8K9h+IfVemzEQZj8=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "969cb076e5b76f2e823aeca1937a3e1f159812ee", + "rev": "87d5d984109c839482b88b4795db073eb9ed446f", "type": "github" }, "original": { @@ -369,11 +369,11 @@ ] }, "locked": { - "lastModified": 1715879663, - "narHash": "sha256-/DwglRvj4XF4ECdNtrCIbthleszAZBwOiXG5A6r0K/c=", + "lastModified": 1716058375, + "narHash": "sha256-CwjWoVnBZE5SBpRx9dgSQGCr4Goxyfcyv3zZbOhVqzk=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "f5181a068c1b06f2db51f6222e50a0c665a2b0c3", + "rev": "3afed4364790aebe0426077631af1e164a9650cc", "type": "github" }, "original": { @@ -392,11 +392,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1715799856, - "narHash": "sha256-PPEVVM95PbEkrD+9KEZGWZrlhPqKanPn717l/sdjQsE=", + "lastModified": 1717346559, + "narHash": "sha256-SpwWUYctOViUjTp3e7x8VxwxntS1tNtpfef7YJKikgs=", "owner": "JakeStanger", "repo": "ironbar", - "rev": "c641b368a5aac7c7fcf97f660b5ee820c724bcdc", + "rev": "5d1054abd8ab5e538073b75450bc1618bd537a7b", "type": "github" }, "original": { @@ -410,11 +410,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1713520724, - "narHash": "sha256-CO8MmVDmqZX2FovL75pu5BvwhW+Vugc7Q6ze7Hj8heI=", + "lastModified": 1717067539, + "narHash": "sha256-oIs5EF+6VpHJRvvpVWuqCYJMMVW/6h59aYUv9lABLtY=", "owner": "nix-community", "repo": "naersk", - "rev": "c5037590290c6c7dae2e42e7da1e247e54ed2d49", + "rev": "fa19d8c135e776dc97f4dcca08656a0eeb28d5c0", "type": "github" }, "original": { @@ -430,11 +430,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1715822547, - "narHash": "sha256-2t+GMP23RRDfEel4YgaCb/qo6d432eJEFFM+4Rn+8b4=", + "lastModified": 1717377936, + "narHash": "sha256-6inBsoiYEsTNJExq1G+0imL5pcDx1IkPf7PUqHARwmU=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "6490ae7fc23e44b455766eb46a90257468596edd", + "rev": "1ae16af500525f1ca1b3295f5ee4e2b1b26f3004", "type": "github" }, "original": { @@ -452,11 +452,11 @@ ] }, "locked": { - "lastModified": 1715888388, - "narHash": "sha256-aoO2kmvBeZ1ADKD5QZDu652IesI4aQ8eOgDFQm7DfA8=", + "lastModified": 1716640344, + "narHash": "sha256-AZKQs+KrL70le0RZH8XqZJMc2SahU4LpfEJ2Vd5SWzM=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "d926f9ff6aa0cafe70b126b20d98086646c166ef", + "rev": "020cd466170204e448b24b246045599fce69ad91", "type": "github" }, "original": { @@ -467,11 +467,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1715787315, - "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", + "lastModified": 1716330097, + "narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", + "rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2", "type": "github" }, "original": { @@ -483,11 +483,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1714314149, - "narHash": "sha256-yNAevSKF4krRWacmLUsLK7D7PlfuY3zF0lYnGYNi9vQ=", + "lastModified": 1717112898, + "narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cf8cc1201be8bc71b7cbbbdaf349b22f4f99c7ae", + "rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0", "type": "github" }, "original": { @@ -513,16 +513,16 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1715668745, - "narHash": "sha256-xp62OkRkbUDNUc6VSqH02jB0FbOS+MsfMb7wL1RJOfA=", + "lastModified": 1717144377, + "narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9ddcaffecdf098822d944d4147dd8da30b4e6843", + "rev": "805a384895c696f802a9bf5bf4720f37385df547", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-23.11", + "ref": "nixos-24.05", "type": "indirect" } }, @@ -544,11 +544,11 @@ }, "nur": { "locked": { - "lastModified": 1715899068, - "narHash": "sha256-dQn+Hv13ln+2d8rbIvGgYMLVGtcZLkghByu0yyRSoVc=", + "lastModified": 1717429509, + "narHash": "sha256-c7mqDqNUP5BVtUZLTeglj5NjM1jvncUZy9fhydhB8RQ=", "owner": "nix-community", "repo": "NUR", - "rev": "f1c319a9df9a7d5b0282c3dbc2a0d3fce30270c8", + "rev": "963de5e47dbd9550a36d90c9075b40002000547a", "type": "github" }, "original": { @@ -583,11 +583,11 @@ ] }, "locked": { - "lastModified": 1714443211, - "narHash": "sha256-lKTA3XqRo4aVgkyTSCtpcALpGXdmkilHTtN00eRg0QU=", + "lastModified": 1717121863, + "narHash": "sha256-/3sxIe7MZqF/jw1RTQCSmgTjwVod43mmrk84m50MJQ4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "ce35c36f58f82cee6ec959e0d44c587d64281b6f", + "rev": "2a7b53172ed08f856b8382d7dcfd36a4e0cbd866", "type": "github" }, "original": { @@ -602,11 +602,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1715825775, - "narHash": "sha256-7np2/EEr5Xm8IuKWQ43q8AA1Lb6Us2BW6rYMxGrInIg=", + "lastModified": 1717406456, + "narHash": "sha256-voWbxOZu1DM6hLOlOkLqSrZ8BsOY6F9h/tYB9C0jOXs=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "55f468b3d49c5d3321e85f2f9b1158476a2a90fb", + "rev": "711ff40be18b09bf096930f52e1fb2fcbee9adf0", "type": "github" }, "original": { @@ -737,11 +737,11 @@ }, "unstable": { "locked": { - "lastModified": 1715787315, - "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", + "lastModified": 1717196966, + "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", + "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", "type": "github" }, "original": { @@ -806,11 +806,11 @@ ] }, "locked": { - "lastModified": 1715788457, - "narHash": "sha256-32HOkjSIyANphV0p5gIwP4ONU/CcinhwOyVFB+tL/d0=", + "lastModified": 1716290197, + "narHash": "sha256-1u9Exrc7yx9qtES2brDh7/DDZ8w8ap1nboIOAtCgeuM=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "af7c87a32f5d67eb2ada908a6a700f4e74831943", + "rev": "91e48d6acd8a5a611d26f925e51559ab743bc438", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 3074b99..ddb8074 100644 --- a/flake.nix +++ b/flake.nix @@ -2,10 +2,21 @@ description = "Michael Thomas's NixOS configuration"; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.11"; + nixpkgs.url = "nixpkgs/nixos-24.05"; unstable.url = "nixpkgs/nixos-unstable"; nur.url = "github:nix-community/NUR"; + home-manager = { + url = "github:rycee/home-manager/release-24.05"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + darwin = { + url = "github:lnl7/nix-darwin/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + utils.url = "github:numtide/flake-utils"; rust-overlay.url = "github:oxalica/rust-overlay"; nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; @@ -14,7 +25,6 @@ url = "github:JakeStanger/ironbar"; inputs.nixpkgs.follows = "nixpkgs"; }; - agenix = { url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -30,18 +40,6 @@ url = "github:nix-community/nixos-vscode-server"; inputs.nixpkgs.follows = "nixpkgs"; }; - - darwin = { - url = "github:lnl7/nix-darwin/master"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - home-manager = { - url = "github:rycee/home-manager/release-23.11"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; }; outputs = { diff --git a/machines/terra/configuration.nix b/machines/terra/configuration.nix index b8cb976..7c90e83 100644 --- a/machines/terra/configuration.nix +++ b/machines/terra/configuration.nix @@ -30,9 +30,9 @@ }; # Configure keymap in X11 - services.xserver = { + services.xserver.xkb = { layout = "us"; - xkbVariant = ""; + variant = ""; }; services.openssh = { diff --git a/modules/avahi.nix b/modules/avahi.nix index 7a5bde0..e0b8145 100644 --- a/modules/avahi.nix +++ b/modules/avahi.nix @@ -2,7 +2,7 @@ # Enable Avahi Network Discovery services.avahi = { enable = true; - nssmdns = true; + nssmdns4 = true; publish.enable = true; publish.addresses = true; }; diff --git a/user/modules/firefox.nix b/user/modules/firefox.nix index b98aa26..f209680 100644 --- a/user/modules/firefox.nix +++ b/user/modules/firefox.nix @@ -5,8 +5,8 @@ source = pkgs.fetchFromGitHub { owner = "rafaelmardojai"; repo = "firefox-gnome-theme"; - rev = "v125"; - hash = "sha256-N1BmvredC7xfZhobNOog0+0KrbGXPbQmmmWHT1eOoBw="; + rev = "v126"; + hash = "sha256-jVbj2JD5GRkP8s3vKBtd9PDpftf3kjLR0ZA/ND/c2+Q="; }; }; diff --git a/user/modules/zsh.nix b/user/modules/zsh.nix index 6172308..35ba7c1 100644 --- a/user/modules/zsh.nix +++ b/user/modules/zsh.nix @@ -1,13 +1,8 @@ -{ - pkgs, - lib, - ... -}: { +{pkgs, ...}: { programs.zsh = { enable = true; - enableAutosuggestions = true; - # autosuggestion.enable = true; + autosuggestion.enable = true; syntaxHighlighting.enable = true; historySubstringSearch.enable = true; autocd = true; From e64b39b8961d308eed53ef657559087a271c009c Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 17:25:35 -0400 Subject: [PATCH 20/33] feat: initial nixvim configuration --- flake.lock | 298 +++++++++- flake.nix | 11 +- overlays/default.nix | 6 +- pkgs/default.nix | 3 +- pkgs/nvim/config/bufferlines/bufferline.nix | 125 +++++ pkgs/nvim/config/colorschemes/base16.nix | 8 + pkgs/nvim/config/colorschemes/catppuccin.nix | 48 ++ pkgs/nvim/config/colorschemes/rose-pine.nix | 14 + pkgs/nvim/config/completion/cmp.nix | 130 +++++ pkgs/nvim/config/completion/copilot.nix | 46 ++ pkgs/nvim/config/completion/lspkind.nix | 12 + pkgs/nvim/config/dap/dap.nix | 222 ++++++++ pkgs/nvim/config/default.nix | 84 +++ pkgs/nvim/config/filetrees/neo-tree.nix | 64 +++ pkgs/nvim/config/git/diffview.nix | 5 + pkgs/nvim/config/git/gitsigns.nix | 92 +++ pkgs/nvim/config/git/lazygit.nix | 20 + pkgs/nvim/config/git/neogit.nix | 12 + pkgs/nvim/config/keymaps.nix | 526 ++++++++++++++++++ pkgs/nvim/config/languages/nvim-jdtls.nix | 81 +++ pkgs/nvim/config/languages/nvim-lint.nix | 16 + .../treesitter/treesitter-context.nix | 5 + .../treesitter/treesitter-textobjects.nix | 50 ++ .../languages/treesitter/treesitter.nix | 8 + .../languages/treesitter/ts-autotag.nix | 5 + .../treesitter/ts-context-commentstring.nix | 6 + .../languages/typescript-tools-nvim.nix | 47 ++ pkgs/nvim/config/lsp/conform.nix | 92 +++ pkgs/nvim/config/lsp/fidget.nix | 99 ++++ pkgs/nvim/config/lsp/lsp.nix | 167 ++++++ pkgs/nvim/config/lsp/lspsaga.nix | 186 +++++++ pkgs/nvim/config/lsp/trouble.nix | 52 ++ pkgs/nvim/config/none-ls/none-ls.nix | 73 +++ pkgs/nvim/config/sets.nix | 145 +++++ pkgs/nvim/config/snippets/luasnip.nix | 19 + pkgs/nvim/config/statusline/lualine.nix | 33 ++ pkgs/nvim/config/statusline/staline.nix | 65 +++ pkgs/nvim/config/telescope/telescope.nix | 178 ++++++ pkgs/nvim/config/ui/alpha.nix | 191 +++++++ pkgs/nvim/config/ui/dressing-nvim.nix | 171 ++++++ pkgs/nvim/config/ui/indent-blankline.nix | 32 ++ pkgs/nvim/config/ui/noice.nix | 36 ++ pkgs/nvim/config/ui/nui.nix | 3 + pkgs/nvim/config/ui/nvim-notify.nix | 44 ++ pkgs/nvim/config/utils/better-escape.nix | 7 + pkgs/nvim/config/utils/flash.nix | 56 ++ pkgs/nvim/config/utils/hardtime.nix | 26 + pkgs/nvim/config/utils/harpoon.nix | 17 + pkgs/nvim/config/utils/illuminate.nix | 17 + pkgs/nvim/config/utils/markdown-preview.nix | 19 + pkgs/nvim/config/utils/mini.nix | 15 + pkgs/nvim/config/utils/neocord.nix | 27 + pkgs/nvim/config/utils/neodev.nix | 11 + pkgs/nvim/config/utils/neotest.nix | 133 +++++ pkgs/nvim/config/utils/nvim-autopairs.nix | 5 + pkgs/nvim/config/utils/nvim-colorizer.nix | 5 + pkgs/nvim/config/utils/nvim-surround.nix | 9 + pkgs/nvim/config/utils/oil.nix | 54 ++ pkgs/nvim/config/utils/persistence.nix | 5 + pkgs/nvim/config/utils/plenary.nix | 5 + pkgs/nvim/config/utils/project-nvim.nix | 6 + pkgs/nvim/config/utils/sidebar.nix | 55 ++ pkgs/nvim/config/utils/tmux-navigator.nix | 5 + pkgs/nvim/config/utils/todo-comments.nix | 5 + pkgs/nvim/config/utils/toggleterm.nix | 57 ++ pkgs/nvim/config/utils/ultimate-autopair.nix | 17 + pkgs/nvim/config/utils/undotree.nix | 26 + pkgs/nvim/config/utils/vim-be-good.nix | 5 + pkgs/nvim/config/utils/wakatime.nix | 5 + pkgs/nvim/config/utils/whichkey.nix | 19 + pkgs/nvim/config/utils/wilder.nix | 43 ++ pkgs/nvim/default.nix | 13 + 72 files changed, 4176 insertions(+), 21 deletions(-) create mode 100644 pkgs/nvim/config/bufferlines/bufferline.nix create mode 100644 pkgs/nvim/config/colorschemes/base16.nix create mode 100644 pkgs/nvim/config/colorschemes/catppuccin.nix create mode 100644 pkgs/nvim/config/colorschemes/rose-pine.nix create mode 100644 pkgs/nvim/config/completion/cmp.nix create mode 100644 pkgs/nvim/config/completion/copilot.nix create mode 100644 pkgs/nvim/config/completion/lspkind.nix create mode 100644 pkgs/nvim/config/dap/dap.nix create mode 100644 pkgs/nvim/config/default.nix create mode 100644 pkgs/nvim/config/filetrees/neo-tree.nix create mode 100644 pkgs/nvim/config/git/diffview.nix create mode 100644 pkgs/nvim/config/git/gitsigns.nix create mode 100644 pkgs/nvim/config/git/lazygit.nix create mode 100644 pkgs/nvim/config/git/neogit.nix create mode 100644 pkgs/nvim/config/keymaps.nix create mode 100644 pkgs/nvim/config/languages/nvim-jdtls.nix create mode 100644 pkgs/nvim/config/languages/nvim-lint.nix create mode 100644 pkgs/nvim/config/languages/treesitter/treesitter-context.nix create mode 100644 pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix create mode 100644 pkgs/nvim/config/languages/treesitter/treesitter.nix create mode 100644 pkgs/nvim/config/languages/treesitter/ts-autotag.nix create mode 100644 pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix create mode 100644 pkgs/nvim/config/languages/typescript-tools-nvim.nix create mode 100644 pkgs/nvim/config/lsp/conform.nix create mode 100644 pkgs/nvim/config/lsp/fidget.nix create mode 100644 pkgs/nvim/config/lsp/lsp.nix create mode 100644 pkgs/nvim/config/lsp/lspsaga.nix create mode 100644 pkgs/nvim/config/lsp/trouble.nix create mode 100644 pkgs/nvim/config/none-ls/none-ls.nix create mode 100644 pkgs/nvim/config/sets.nix create mode 100644 pkgs/nvim/config/snippets/luasnip.nix create mode 100644 pkgs/nvim/config/statusline/lualine.nix create mode 100644 pkgs/nvim/config/statusline/staline.nix create mode 100644 pkgs/nvim/config/telescope/telescope.nix create mode 100644 pkgs/nvim/config/ui/alpha.nix create mode 100644 pkgs/nvim/config/ui/dressing-nvim.nix create mode 100644 pkgs/nvim/config/ui/indent-blankline.nix create mode 100644 pkgs/nvim/config/ui/noice.nix create mode 100644 pkgs/nvim/config/ui/nui.nix create mode 100644 pkgs/nvim/config/ui/nvim-notify.nix create mode 100644 pkgs/nvim/config/utils/better-escape.nix create mode 100644 pkgs/nvim/config/utils/flash.nix create mode 100644 pkgs/nvim/config/utils/hardtime.nix create mode 100644 pkgs/nvim/config/utils/harpoon.nix create mode 100644 pkgs/nvim/config/utils/illuminate.nix create mode 100644 pkgs/nvim/config/utils/markdown-preview.nix create mode 100644 pkgs/nvim/config/utils/mini.nix create mode 100644 pkgs/nvim/config/utils/neocord.nix create mode 100644 pkgs/nvim/config/utils/neodev.nix create mode 100644 pkgs/nvim/config/utils/neotest.nix create mode 100644 pkgs/nvim/config/utils/nvim-autopairs.nix create mode 100644 pkgs/nvim/config/utils/nvim-colorizer.nix create mode 100644 pkgs/nvim/config/utils/nvim-surround.nix create mode 100644 pkgs/nvim/config/utils/oil.nix create mode 100644 pkgs/nvim/config/utils/persistence.nix create mode 100644 pkgs/nvim/config/utils/plenary.nix create mode 100644 pkgs/nvim/config/utils/project-nvim.nix create mode 100644 pkgs/nvim/config/utils/sidebar.nix create mode 100644 pkgs/nvim/config/utils/tmux-navigator.nix create mode 100644 pkgs/nvim/config/utils/todo-comments.nix create mode 100644 pkgs/nvim/config/utils/toggleterm.nix create mode 100644 pkgs/nvim/config/utils/ultimate-autopair.nix create mode 100644 pkgs/nvim/config/utils/undotree.nix create mode 100644 pkgs/nvim/config/utils/vim-be-good.nix create mode 100644 pkgs/nvim/config/utils/wakatime.nix create mode 100644 pkgs/nvim/config/utils/whichkey.nix create mode 100644 pkgs/nvim/config/utils/wilder.nix create mode 100644 pkgs/nvim/default.nix diff --git a/flake.lock b/flake.lock index 66d9a01..4d6dab4 100644 --- a/flake.lock +++ b/flake.lock @@ -87,6 +87,28 @@ "type": "github" } }, + "devshell": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713532798, + "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=", + "owner": "numtide", + "repo": "devshell", + "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -119,6 +141,72 @@ "type": "github" } }, + "flake-compat_3": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-root": { + "locked": { + "lastModified": 1713493429, + "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", + "owner": "srid", + "repo": "flake-root", + "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "flake-root", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems_3" @@ -177,6 +265,24 @@ "inputs": { "systems": "systems_6" }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "inputs": { + "systems": "systems_7" + }, "locked": { "lastModified": 1705309234, "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", @@ -191,9 +297,9 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_6": { "inputs": { - "systems": "systems_8" + "systems": "systems_9" }, "locked": { "lastModified": 1681202837, @@ -209,6 +315,55 @@ "type": "github" } }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_4", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716213921, + "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -251,6 +406,27 @@ "type": "github" } }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717052710, + "narHash": "sha256-LRhOxzXmOza5SymhOgnEzA8EAQp+94kkeUYWKKpLJ/U=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "29c69d9a466e41d46fd3a7a9d0591ef9c113c2ae", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "hyprcursor": { "inputs": { "hyprlang": [ @@ -290,11 +466,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1717362715, - "narHash": "sha256-EnkKVUYqVfYqJso4t8ScuuMNEge7eybpdvtPCy4uwlc=", + "lastModified": 1717442018, + "narHash": "sha256-GhL4f5CedZE0UiuzUFkMwGXD+zqlhrzo0y4FC4wQLTM=", "ref": "refs/heads/main", - "rev": "358e59e69d27a69381bc0872b5b8d1184bc6b6a1", - "revCount": 4756, + "rev": "5517cc506b2754cb2485b1bf3e46918ee638ea6d", + "revCount": 4760, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -392,11 +568,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1717346559, - "narHash": "sha256-SpwWUYctOViUjTp3e7x8VxwxntS1tNtpfef7YJKikgs=", + "lastModified": 1717443201, + "narHash": "sha256-a0ZXSNQvklHhUkCnX+4wGN8Bu5WkG+I85h7NcKlehdk=", "owner": "JakeStanger", "repo": "ironbar", - "rev": "5d1054abd8ab5e538073b75450bc1618bd537a7b", + "rev": "6e921eb567164f4ad46a7c74d665b3dc6223f928", "type": "github" }, "original": { @@ -423,6 +599,27 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716993688, + "narHash": "sha256-vo5k2wQekfeoq/2aleQkBN41dQiQHNTniZeVONWiWLs=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "c0d5b8c54d6828516c97f6be9f2d00c63a363df4", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-vscode-extensions": { "inputs": { "flake-compat": "flake-compat", @@ -542,13 +739,41 @@ "type": "github" } }, + "nixvim": { + "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat_3", + "flake-parts": "flake-parts", + "flake-root": "flake-root", + "git-hooks": "git-hooks", + "home-manager": "home-manager_3", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1717444597, + "narHash": "sha256-8enVHsN7hLn1hPkY1U5Cfr3rzij4FsWRUx4jjHUHZQE=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "b7a8b0319098fdbaa719ef4dc375337ec4543c6e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, "nur": { "locked": { - "lastModified": 1717429509, - "narHash": "sha256-c7mqDqNUP5BVtUZLTeglj5NjM1jvncUZy9fhydhB8RQ=", + "lastModified": 1717443933, + "narHash": "sha256-hKPYAOnbqvy/eZMsp85KRHn5+K3QkGeU8cyLiXtxT48=", "owner": "nix-community", "repo": "NUR", - "rev": "963de5e47dbd9550a36d90c9075b40002000547a", + "rev": "0122b0f415811dd2a367f362a595070b6451ff9a", "type": "github" }, "original": { @@ -567,6 +792,7 @@ "nix-vscode-extensions": "nix-vscode-extensions", "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs_4", + "nixvim": "nixvim", "nur": "nur", "rust-overlay": "rust-overlay_2", "unstable": "unstable", @@ -598,15 +824,15 @@ }, "rust-overlay_2": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1717406456, - "narHash": "sha256-voWbxOZu1DM6hLOlOkLqSrZ8BsOY6F9h/tYB9C0jOXs=", + "lastModified": 1717442957, + "narHash": "sha256-w0fqHofxM2hf3pGDXCPSdH0A09v6FgHm6I38nCWA96k=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "711ff40be18b09bf096930f52e1fb2fcbee9adf0", + "rev": "025e1742de4fa75b3fb63818bd9726d17da6a102", "type": "github" }, "original": { @@ -735,6 +961,42 @@ "type": "github" } }, + "systems_9": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715940852, + "narHash": "sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "2fba33a182602b9d49f0b2440513e5ee091d838b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "unstable": { "locked": { "lastModified": 1717196966, @@ -752,7 +1014,7 @@ }, "utils": { "inputs": { - "systems": "systems_7" + "systems": "systems_8" }, "locked": { "lastModified": 1710146030, @@ -770,7 +1032,7 @@ }, "vscode-server": { "inputs": { - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "nixpkgs": [ "nixpkgs" ] diff --git a/flake.nix b/flake.nix index ddb8074..6906103 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,11 @@ }; utils.url = "github:numtide/flake-utils"; + nixvim = { + # url = "github:nix-community/nixvim/nixos-24.05"; + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; rust-overlay.url = "github:oxalica/rust-overlay"; nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; @@ -67,7 +72,11 @@ in { # Your custom packages # Accessible through 'nix build', 'nix shell', etc - packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + packages = forAllSystems (system: + import ./pkgs { + pkgs = nixpkgs.legacyPackages.${system}; + inherit inputs; + }); overlays = import ./overlays {inherit inputs;}; diff --git a/overlays/default.nix b/overlays/default.nix index 85e4b9f..b9cb445 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -3,7 +3,11 @@ vscode-extensions = inputs.nix-vscode-extensions.overlays.default; # This one brings our custom packages from the 'pkgs' directory - additions = final: _prev: import ../pkgs final.pkgs; + additions = final: _prev: + import ../pkgs { + pkgs = final.pkgs; + inherit inputs; + }; # This one contains whatever you want to overlay # You can change versions, add patches, set compilation flags, anything really. diff --git a/pkgs/default.nix b/pkgs/default.nix index 7894653..bb4c612 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,5 @@ -pkgs: { +{pkgs, ...} @ args: { homer = pkgs.callPackage ./homer {}; keycloak-theme-keywind = pkgs.callPackage ./keywind {}; + nvim-custom = import ./nvim/default.nix args; } diff --git a/pkgs/nvim/config/bufferlines/bufferline.nix b/pkgs/nvim/config/bufferlines/bufferline.nix new file mode 100644 index 0000000..9b717cd --- /dev/null +++ b/pkgs/nvim/config/bufferlines/bufferline.nix @@ -0,0 +1,125 @@ +{ + plugins = { + bufferline = { + enable = true; + separatorStyle = "thick"; # “slant”, “padded_slant”, “slope”, “padded_slope”, “thick”, “thin” + offsets = [ + { + filetype = "neo-tree"; + text = "Neo-tree"; + highlight = "Directory"; + text_align = "left"; + } + ]; + }; + }; + keymaps = [ + { + mode = "n"; + key = ""; + action = "BufferLineCycleNext"; + options = { + desc = "Cycle to next buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCyclePrev"; + options = { + desc = "Cycle to previous buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCycleNext"; + options = { + desc = "Cycle to next buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCyclePrev"; + options = { + desc = "Cycle to previous buffer"; + }; + } + + { + mode = "n"; + key = "bd"; + action = "bdelete"; + options = { + desc = "Delete buffer"; + }; + } + + { + mode = "n"; + key = "bb"; + action = "e #"; + options = { + desc = "Switch to Other Buffer"; + }; + } + + # { + # mode = "n"; + # key = "`"; + # action = "e #"; + # options = { + # desc = "Switch to Other Buffer"; + # }; + # } + + { + mode = "n"; + key = "br"; + action = "BufferLineCloseRight"; + options = { + desc = "Delete buffers to the right"; + }; + } + + { + mode = "n"; + key = "bl"; + action = "BufferLineCloseLeft"; + options = { + desc = "Delete buffers to the left"; + }; + } + + { + mode = "n"; + key = "bo"; + action = "BufferLineCloseOthers"; + options = { + desc = "Delete other buffers"; + }; + } + + { + mode = "n"; + key = "bp"; + action = "BufferLineTogglePin"; + options = { + desc = "Toggle pin"; + }; + } + + { + mode = "n"; + key = "bP"; + action = "BufferLineGroupClose ungrouped"; + options = { + desc = "Delete non-pinned buffers"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/colorschemes/base16.nix b/pkgs/nvim/config/colorschemes/base16.nix new file mode 100644 index 0000000..ffea1b3 --- /dev/null +++ b/pkgs/nvim/config/colorschemes/base16.nix @@ -0,0 +1,8 @@ +{ + colorschemes = { + base16 = { + enable = false; + colorscheme = "mountain"; + }; + }; +} diff --git a/pkgs/nvim/config/colorschemes/catppuccin.nix b/pkgs/nvim/config/colorschemes/catppuccin.nix new file mode 100644 index 0000000..312d28a --- /dev/null +++ b/pkgs/nvim/config/colorschemes/catppuccin.nix @@ -0,0 +1,48 @@ +{ + colorschemes = { + catppuccin = { + enable = true; + settings = { + background = { + light = "macchiato"; + dark = "mocha"; + }; + flavour = "mocha"; # "latte", "mocha", "frappe", "macchiato" or raw lua code + disable_bold = false; + disable_italic = false; + disable_underline = false; + transparent_background = true; + term_colors = true; + integrations = { + cmp = true; + noice = true; + notify = true; + neotree = true; + harpoon = true; + gitsigns = true; + which_key = true; + illuminate = { + enabled = true; + }; + treesitter = true; + treesitter_context = true; + telescope.enabled = true; + indent_blankline.enabled = true; + mini.enabled = true; + native_lsp = { + enabled = true; + inlay_hints = { + background = true; + }; + underlines = { + errors = ["underline"]; + hints = ["underline"]; + information = ["underline"]; + warnings = ["underline"]; + }; + }; + }; + }; + }; + }; +} diff --git a/pkgs/nvim/config/colorschemes/rose-pine.nix b/pkgs/nvim/config/colorschemes/rose-pine.nix new file mode 100644 index 0000000..2077010 --- /dev/null +++ b/pkgs/nvim/config/colorschemes/rose-pine.nix @@ -0,0 +1,14 @@ +{ + colorschemes = { + rose-pine = { + enable = false; + settings = { + styles = { + italic = true; + bold = true; + transparency = false; + }; + }; + }; + }; +} diff --git a/pkgs/nvim/config/completion/cmp.nix b/pkgs/nvim/config/completion/cmp.nix new file mode 100644 index 0000000..012ff9e --- /dev/null +++ b/pkgs/nvim/config/completion/cmp.nix @@ -0,0 +1,130 @@ +{ + plugins = { + cmp-nvim-lsp = {enable = true;}; # lsp + cmp-buffer = {enable = true;}; + copilot-cmp = {enable = true;}; # copilot suggestions + cmp-path = {enable = true;}; # file system paths + cmp_luasnip = {enable = true;}; # snippets + cmp-cmdline = {enable = false;}; # autocomplete for cmdline + cmp = { + enable = true; + autoEnableSources = false; + settings = { + experimental = { + ghost_text = true; + }; + }; + settings = { + mapping = { + __raw = '' + cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.abort(), + + [''] = cmp.mapping.scroll_docs(-4), + + [''] = cmp.mapping.scroll_docs(4), + + [''] = cmp.mapping.complete(), + + [''] = cmp.mapping.confirm({ select = true }), + + [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), + }) + ''; + }; + snippet = { + expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + }; + sources = { + __raw = '' + cmp.config.sources({ + {name = 'nvim_lsp'}, + {name = 'copilot'}, + {name = 'path'}, + {name = 'luasnip'}, + {name = 'cmdline'}, + }, { + {name = 'buffer'}, + }) + ''; + }; + performance = { + debounce = 60; + fetching_timeout = 200; + max_view_entries = 30; + }; + window = { + completion = { + border = "rounded"; + winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None"; + }; + documentation = { + border = "rounded"; + }; + }; + formatting = { + fields = ["kind" "abbr" "menu"]; + expandable_indicator = true; + }; + }; + }; + }; + extraConfigLua = '' + luasnip = require("luasnip") + kind_icons = { + Text = "󰊄", + Method = "", + Function = "󰡱", + Constructor = "", + Field = "", + Variable = "󱀍", + Class = "", + Interface = "", + Module = "󰕳", + Property = "", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", + } + + local cmp = require'cmp' + + -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({'/', "?" }, { + sources = { + { name = 'buffer' } + } + }) + + -- Set configuration for specific filetype. + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }), + }) ''; +} diff --git a/pkgs/nvim/config/completion/copilot.nix b/pkgs/nvim/config/completion/copilot.nix new file mode 100644 index 0000000..4f8be48 --- /dev/null +++ b/pkgs/nvim/config/completion/copilot.nix @@ -0,0 +1,46 @@ +{ + plugins.copilot-lua = { + enable = true; + panel = { + enabled = false; + autoRefresh = true; + keymap = { + jumpPrev = "[["; + jumpNext = "]]"; + accept = ""; + refresh = "gr"; + open = ""; + }; + layout = { + position = "bottom"; # | top | left | right + ratio = 0.4; + }; + }; + suggestion = { + enabled = false; + autoTrigger = true; + debounce = 75; + keymap = { + accept = ""; + acceptWord = false; + acceptLine = false; + next = ""; + prev = ""; + dismiss = ""; + }; + }; + filetypes = { + yaml = false; + markdown = false; + help = false; + gitcommit = false; + gitrebase = false; + hgcommit = false; + svn = false; + cvs = false; + "." = false; + }; + copilotNodeCommand = "node"; # Node.js version must be > 18.x + serverOptsOverrides = {}; + }; +} diff --git a/pkgs/nvim/config/completion/lspkind.nix b/pkgs/nvim/config/completion/lspkind.nix new file mode 100644 index 0000000..69e8f78 --- /dev/null +++ b/pkgs/nvim/config/completion/lspkind.nix @@ -0,0 +1,12 @@ +{ + plugins.lspkind = { + enable = true; + symbolMap = { + Copilot = ""; + }; + extraOptions = { + maxwidth = 50; + ellipsis_char = "..."; + }; + }; +} diff --git a/pkgs/nvim/config/dap/dap.nix b/pkgs/nvim/config/dap/dap.nix new file mode 100644 index 0000000..20fe615 --- /dev/null +++ b/pkgs/nvim/config/dap/dap.nix @@ -0,0 +1,222 @@ +{ + plugins.dap = { + enable = true; + signs = { + dapBreakpoint = { + text = "●"; + texthl = "DapBreakpoint"; + }; + dapBreakpointCondition = { + text = "●"; + texthl = "DapBreakpointCondition"; + }; + dapLogPoint = { + text = "◆"; + texthl = "DapLogPoint"; + }; + }; + extensions = { + dap-python = { + enable = true; + }; + dap-ui = { + enable = true; + floating.mappings = { + close = ["" "q"]; + }; + }; + dap-virtual-text = { + enable = true; + }; + }; + configurations = { + java = [ + { + type = "java"; + request = "launch"; + name = "Debug (Attach) - Remote"; + hostName = "127.0.0.1"; + port = 5005; + } + ]; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "dB"; + action = " + lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) + "; + options = { + silent = true; + desc = "Breakpoint Condition"; + }; + } + { + mode = "n"; + key = "db"; + action = ":DapToggleBreakpoint"; + options = { + silent = true; + desc = "Toggle Breakpoint"; + }; + } + { + mode = "n"; + key = "dc"; + action = ":DapContinue"; + options = { + silent = true; + desc = "Continue"; + }; + } + { + mode = "n"; + key = "da"; + action = "lua require('dap').continue({ before = get_args })"; + options = { + silent = true; + desc = "Run with Args"; + }; + } + { + mode = "n"; + key = "dC"; + action = "lua require('dap').run_to_cursor()"; + options = { + silent = true; + desc = "Run to cursor"; + }; + } + { + mode = "n"; + key = "dg"; + action = "lua require('dap').goto_()"; + options = { + silent = true; + desc = "Go to line (no execute)"; + }; + } + { + mode = "n"; + key = "di"; + action = ":DapStepInto"; + options = { + silent = true; + desc = "Step into"; + }; + } + { + mode = "n"; + key = "dj"; + action = " + lua require('dap').down() + "; + options = { + silent = true; + desc = "Down"; + }; + } + { + mode = "n"; + key = "dk"; + action = "lua require('dap').up()"; + options = { + silent = true; + desc = "Up"; + }; + } + { + mode = "n"; + key = "dl"; + action = "lua require('dap').run_last()"; + options = { + silent = true; + desc = "Run Last"; + }; + } + { + mode = "n"; + key = "do"; + action = ":DapStepOut"; + options = { + silent = true; + desc = "Step Out"; + }; + } + { + mode = "n"; + key = "dO"; + action = ":DapStepOver"; + options = { + silent = true; + desc = "Step Over"; + }; + } + { + mode = "n"; + key = "dp"; + action = "lua require('dap').pause()"; + options = { + silent = true; + desc = "Pause"; + }; + } + { + mode = "n"; + key = "dr"; + action = ":DapToggleRepl"; + options = { + silent = true; + desc = "Toggle REPL"; + }; + } + { + mode = "n"; + key = "ds"; + action = "lua require('dap').session()"; + options = { + silent = true; + desc = "Session"; + }; + } + { + mode = "n"; + key = "dt"; + action = ":DapTerminate"; + options = { + silent = true; + desc = "Terminate"; + }; + } + { + mode = "n"; + key = "du"; + action = "lua require('dapui').toggle()"; + options = { + silent = true; + desc = "Dap UI"; + }; + } + { + mode = "n"; + key = "dw"; + action = "lua require('dap.ui.widgets').hover()"; + options = { + silent = true; + desc = "Widgets"; + }; + } + { + mode = ["n" "v"]; + key = "de"; + action = "lua require('dapui').eval()"; + options = { + silent = true; + desc = "Eval"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/default.nix b/pkgs/nvim/config/default.nix new file mode 100644 index 0000000..ff983f7 --- /dev/null +++ b/pkgs/nvim/config/default.nix @@ -0,0 +1,84 @@ +{ + # Import all your configuration modules here + imports = [ + ./sets.nix + ./keymaps.nix + + ./bufferlines/bufferline.nix + + ./colorschemes/base16.nix + ./colorschemes/catppuccin.nix + ./colorschemes/rose-pine.nix + + ./completion/cmp.nix + ./completion/copilot.nix + ./completion/lspkind.nix + + ./dap/dap.nix + + ./filetrees/neo-tree.nix + ./git/gitsigns.nix + ./git/diffview.nix + # ./git/lazygit.nix + ./git/neogit.nix + + ./languages/nvim-jdtls.nix + ./languages/nvim-lint.nix + ./languages/typescript-tools-nvim.nix + ./languages/treesitter/treesitter.nix + ./languages/treesitter/treesitter-context.nix + ./languages/treesitter/treesitter-textobjects.nix + ./languages/treesitter/ts-autotag.nix + ./languages/treesitter/ts-context-commentstring.nix + + ./lsp/conform.nix + ./lsp/fidget.nix + ./lsp/lsp.nix + ./lsp/lspsaga.nix + ./lsp/trouble.nix + + ./none-ls/none-ls.nix + + ./snippets/luasnip.nix + + ./statusline/lualine.nix + ./statusline/staline.nix + + ./telescope/telescope.nix + + ./ui/alpha.nix + ./ui/dressing-nvim.nix + ./ui/indent-blankline.nix + ./ui/noice.nix + ./ui/nvim-notify.nix + ./ui/nui.nix + + ./utils/better-escape.nix + ./utils/neocord.nix + ./utils/flash.nix + ./utils/hardtime.nix + ./utils/harpoon.nix + ./utils/illuminate.nix + ./utils/markdown-preview.nix + ./utils/mini.nix + ./utils/neodev.nix + ./utils/neotest.nix + ./utils/nvim-autopairs.nix + ./utils/nvim-colorizer.nix + ./utils/nvim-surround.nix + ./utils/oil.nix + ./utils/persistence.nix + ./utils/plenary.nix + ./utils/project-nvim.nix + ./utils/sidebar.nix + ./utils/tmux-navigator.nix + ./utils/todo-comments.nix + ./utils/toggleterm.nix + ./utils/ultimate-autopair.nix + ./utils/undotree.nix + ./utils/vim-be-good.nix + ./utils/wakatime.nix + ./utils/whichkey.nix + ./utils/wilder.nix + ]; +} diff --git a/pkgs/nvim/config/filetrees/neo-tree.nix b/pkgs/nvim/config/filetrees/neo-tree.nix new file mode 100644 index 0000000..c83589e --- /dev/null +++ b/pkgs/nvim/config/filetrees/neo-tree.nix @@ -0,0 +1,64 @@ +{ + plugins.neo-tree = { + enable = false; + enableDiagnostics = true; + enableGitStatus = true; + enableModifiedMarkers = true; + enableRefreshOnWrite = true; + closeIfLastWindow = true; + popupBorderStyle = "rounded"; # Type: null or one of “NC”, “double”, “none”, “rounded”, “shadow”, “single”, “solid” or raw lua code + buffers = { + bindToCwd = false; + followCurrentFile = { + enabled = true; + }; + }; + window = { + width = 40; + height = 15; + autoExpandWidth = false; + mappings = { + "" = "none"; + }; + }; + }; + + # keymaps = [ + # { + # mode = "n"; + # key = "e"; + # action = ":Neotree toggle reveal_force_cwd"; + # options = { + # silent = true; + # desc = "Explorer NeoTree (root dir)"; + # }; + # } + # { + # mode = "n"; + # key = "E"; + # action = "Neotree toggle"; + # options = { + # silent = true; + # desc = "Explorer NeoTree (cwd)"; + # }; + # } + # { + # mode = "n"; + # key = "be"; + # action = ":Neotree buffers"; + # options = { + # silent = true; + # desc = "Buffer explorer"; + # }; + # } + # { + # mode = "n"; + # key = "ge"; + # action = ":Neotree git_status"; + # options = { + # silent = true; + # desc = "Git explorer"; + # }; + # } + # ]; +} diff --git a/pkgs/nvim/config/git/diffview.nix b/pkgs/nvim/config/git/diffview.nix new file mode 100644 index 0000000..fa672d0 --- /dev/null +++ b/pkgs/nvim/config/git/diffview.nix @@ -0,0 +1,5 @@ +{ + plugins.diffview = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/git/gitsigns.nix b/pkgs/nvim/config/git/gitsigns.nix new file mode 100644 index 0000000..67814df --- /dev/null +++ b/pkgs/nvim/config/git/gitsigns.nix @@ -0,0 +1,92 @@ +{ + plugins.gitsigns = { + enable = true; + settings = { + trouble = true; + current_line_blame = false; + }; + }; + keymaps = [ + { + mode = ["n" "v"]; + key = "gh"; + action = "gitsigns"; + options = { + silent = true; + desc = "+hunks"; + }; + } + { + mode = "n"; + key = "ghb"; + action = ":Gitsigns blame_line"; + options = { + silent = true; + desc = "Blame line"; + }; + } + { + mode = "n"; + key = "ghd"; + action = ":Gitsigns diffthis"; + options = { + silent = true; + desc = "Diff This"; + }; + } + { + mode = "n"; + key = "ghp"; + action = ":Gitsigns preview_hunk"; + options = { + silent = true; + desc = "Preview hunk"; + }; + } + { + mode = "n"; + key = "ghR"; + action = ":Gitsigns reset_buffer"; + options = { + silent = true; + desc = "Reset Buffer"; + }; + } + { + mode = ["n" "v"]; + key = "ghr"; + action = ":Gitsigns reset_hunk"; + options = { + silent = true; + desc = "Reset Hunk"; + }; + } + { + mode = ["n" "v"]; + key = "ghs"; + action = ":Gitsigns stage_hunk"; + options = { + silent = true; + desc = "Stage Hunk"; + }; + } + { + mode = "n"; + key = "ghS"; + action = ":Gitsigns stage_buffer"; + options = { + silent = true; + desc = "Stage Buffer"; + }; + } + { + mode = "n"; + key = "ghu"; + action = ":Gitsigns undo_stage_hunk"; + options = { + silent = true; + desc = "Undo Stage Hunk"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/git/lazygit.nix b/pkgs/nvim/config/git/lazygit.nix new file mode 100644 index 0000000..4ad017a --- /dev/null +++ b/pkgs/nvim/config/git/lazygit.nix @@ -0,0 +1,20 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + lazygit-nvim + ]; + + extraConfigLua = '' + require("telescope").load_extension("lazygit") + ''; + + keymaps = [ + { + mode = "n"; + key = "gg"; + action = "LazyGit"; + options = { + desc = "LazyGit (root dir)"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/git/neogit.nix b/pkgs/nvim/config/git/neogit.nix new file mode 100644 index 0000000..a39a9ea --- /dev/null +++ b/pkgs/nvim/config/git/neogit.nix @@ -0,0 +1,12 @@ +{ + plugins.neogit = { + enable = true; + }; + keymaps = [ + { + mode = "n"; + key = "gg"; + action = "Neogit"; + } + ]; +} diff --git a/pkgs/nvim/config/keymaps.nix b/pkgs/nvim/config/keymaps.nix new file mode 100644 index 0000000..64dd1bb --- /dev/null +++ b/pkgs/nvim/config/keymaps.nix @@ -0,0 +1,526 @@ +# Thanks for the keybinds primeagen and folke! +{ + globals.mapleader = " "; + + # TODO: Move general mappings to which-key + keymaps = [ + # Disable arrow keys + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Up arrow key"; + }; + } + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Down arrow key"; + }; + } + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Right arrow key"; + }; + } + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Left arrow key"; + }; + } + + # General maps + { + mode = "n"; + key = "f"; + action = "+find/file"; + } + + { + mode = "n"; + key = "s"; + action = "+search"; + } + + { + mode = "n"; + key = "q"; + action = "+quit/session"; + } + + { + mode = ["n" "v"]; + key = "g"; + action = "+git"; + } + + { + mode = "n"; + key = "u"; + action = "+ui"; + } + + { + mode = "n"; + key = "w"; + action = "+windows"; + } + + { + mode = "n"; + key = ""; + action = "+tab"; + } + + { + mode = ["n" "v"]; + key = "d"; + action = "+debug"; + } + + { + mode = ["n" "v"]; + key = "c"; + action = "+code"; + } + + { + mode = ["n" "v"]; + key = "t"; + action = "+test"; + } + + # Tabs + { + mode = "n"; + key = "l"; + action = "tablast"; + options = { + silent = true; + desc = "Last tab"; + }; + } + + { + mode = "n"; + key = "f"; + action = "tabfirst"; + options = { + silent = true; + desc = "First Tab"; + }; + } + + { + mode = "n"; + key = ""; + action = "tabnew"; + options = { + silent = true; + desc = "New Tab"; + }; + } + + { + mode = "n"; + key = "]"; + action = "tabnext"; + options = { + silent = true; + desc = "Next Tab"; + }; + } + + { + mode = "n"; + key = "d"; + action = "tabclose"; + options = { + silent = true; + desc = "Close tab"; + }; + } + + { + mode = "n"; + key = "["; + action = "tabprevious"; + options = { + silent = true; + desc = "Previous Tab"; + }; + } + + # Windows + { + mode = "n"; + key = "ww"; + action = "p"; + options = { + silent = true; + desc = "Other window"; + }; + } + + { + mode = "n"; + key = "wd"; + action = "c"; + options = { + silent = true; + desc = "Delete window"; + }; + } + + { + mode = "n"; + key = "w-"; + action = "s"; + options = { + silent = true; + desc = "Split window below"; + }; + } + + { + mode = "n"; + key = "w|"; + action = "v"; + options = { + silent = true; + desc = "Split window right"; + }; + } + + # { + # mode = "n"; + # key = "-"; + # action = "s"; + # options = { + # silent = true; + # desc = "Split window below"; + # }; + # } + + # { + # mode = "n"; + # key = "|"; + # action = "v"; + # options = { + # silent = true; + # desc = "Split window right"; + # }; + # } + + { + mode = "n"; + key = ""; + action = "w"; + options = { + silent = true; + desc = "Save file"; + }; + } + + # Quit/Session + { + mode = "n"; + key = "qq"; + action = "quitall"; + options = { + silent = true; + desc = "Quit all"; + }; + } + + { + mode = "n"; + key = "qs"; + action = ":lua require('persistence').load()"; + options = { + silent = true; + desc = "Restore session"; + }; + } + + { + mode = "n"; + key = "ql"; + action = "lua require('persistence').load({ last = true })"; + options = { + silent = true; + desc = "Restore last session"; + }; + } + + { + mode = "n"; + key = "qd"; + action = "lua require('persistence').stop()"; + options = { + silent = true; + desc = "Don't save current session"; + }; + } + + { + mode = "n"; + key = "ul"; + action = ":lua ToggleLineNumber()"; + options = { + silent = true; + desc = "Toggle Line Numbers"; + }; + } + + { + mode = "n"; + key = "uL"; + action = ":lua ToggleRelativeLineNumber()"; + options = { + silent = true; + desc = "Toggle Relative Line Numbers"; + }; + } + + { + mode = "n"; + key = "uw"; + action = ":lua ToggleWrap()"; + options = { + silent = true; + desc = "Toggle Line Wrap"; + }; + } + + { + mode = "v"; + key = "J"; + action = ":m '>+1gv=gv"; + options = { + silent = true; + desc = "Move up when line is highlighted"; + }; + } + + { + mode = "v"; + key = "K"; + action = ":m '<-2gv=gv"; + options = { + silent = true; + desc = "Move down when line is highlighted"; + }; + } + + { + mode = "n"; + key = "J"; + action = "mzJ`z"; + options = { + silent = true; + desc = "Allow cursor to stay in the same place after appeding to current line"; + }; + } + + { + mode = "v"; + key = "<"; + action = " + y or just y to have it just in vim + { + mode = ["n" "v"]; + key = "y"; + action = "\"+y"; + options = { + desc = "Copy to system clipboard"; + }; + } + + { + mode = ["n" "v"]; + key = "Y"; + action = "\"+Y"; + options = { + desc = "Copy to system clipboard"; + }; + } + + # Delete to void register + { + mode = ["n" "v"]; + key = "D"; + action = "\"_d"; + options = { + desc = "Delete to void register"; + }; + } + + # instead of pressing esc just because + { + mode = "i"; + key = ""; + action = ""; + } + + { + mode = "n"; + key = ""; + action = "!tmux new tmux-sessionizer"; + options = { + desc = "Switch between projects"; + }; + } + ]; + extraConfigLua = '' + local notify = require("notify") + + local function show_notification(message, level) + notify(message, level, { title = "conform.nvim" }) + end + + function ToggleLineNumber() + if vim.wo.number then + vim.wo.number = false + show_notification("Line numbers disabled", "info") + else + vim.wo.number = true + vim.wo.relativenumber = false + show_notification("Line numbers enabled", "info") + end + end + + function ToggleRelativeLineNumber() + if vim.wo.relativenumber then + vim.wo.relativenumber = false + show_notification("Relative line numbers disabled", "info") + else + vim.wo.relativenumber = true + vim.wo.number = false + show_notification("Relative line numbers enabled", "info") + end + end + + function ToggleWrap() + if vim.wo.wrap then + vim.wo.wrap = false + show_notification("Wrap disabled", "info") + else + vim.wo.wrap = true + vim.wo.number = false + show_notification("Wrap enabled", "info") + end + end + + if vim.lsp.inlay_hint then + vim.keymap.set('n', 'uh', function() + vim.lsp.inlay_hint(0, nil) + end, { desc = 'Toggle Inlay Hints' }) + end + ''; +} diff --git a/pkgs/nvim/config/languages/nvim-jdtls.nix b/pkgs/nvim/config/languages/nvim-jdtls.nix new file mode 100644 index 0000000..b3d4d0a --- /dev/null +++ b/pkgs/nvim/config/languages/nvim-jdtls.nix @@ -0,0 +1,81 @@ +let + javaTestPath = "/nix/store/j3nvmhvj2pmnykw5pbm51dn0bz4cv6j3-vscode-extension-vscjava-vscode-java-test-0.38.2023032402/share/vscode/extensions/vscjava.vscode-java-test/server/com.microsoft.java.test.plugin-0.38.2.jar + "; +in { + plugins.nvim-jdtls = { + enable = true; + cmd = [ + "/nix/store/20h2hjjm94gbskqhbwikbgxbblv1xpf2-jdt-language-server-1.31.0/bin/jdtls" + ]; + # configuration = "/path/to/configuration"; + data = "~/.cache/jdtls/workspace"; + settings = { + java = { + signatureHelp = true; + completion = true; + }; + }; + initOptions = { + bundles = [ + "/nix/store/b9ib40q36wxjl4xs5lng263lflz1fsi7-vscode-extension-vscjava-vscode-java-debug-0.49.2023032407/share/vscode/extensions/vscjava.vscode-java-debug/server/com.microsoft.java.debug.plugin-0.44.0.jar" + "${javaTestPath}" + ]; + }; + }; +} +# +# extraConfigLua = '' +# local jdtls = require("jdtls") +# local cmp_nvim_lsp = require("cmp_nvim_lsp") +# +# local root_dir = require("jdtls.setup").find_root({ "packageInfo" }, "Config") +# local home = os.getenv("HOME") +# local eclipse_workspace = home .. "/.local/share/eclipse/" .. vim.fn.fnamemodify(root_dir, ":p:h:t") +# +# local ws_folders_jdtls = {} +# if root_dir then +# local file = io.open(root_dir .. "/.bemol/ws_root_folders") +# if file then +# for line in file:lines() do +# table.insert(ws_folders_jdtls, "file://" .. line) +# end +# file:close() +# end +# end +# +# -- for completions +# local client_capabilities = vim.lsp.protocol.make_client_capabilities() +# local capabilities = cmp_nvim_lsp.default_capabilities(client_capabilities) +# +# local config = { +# capabilities = capabilities, +# cmd = { +# "${pkgs.jdt-language-server}/bin/jdt-language-server", +# "--jvm-arg=-javaagent:" .. home .. "/Developer/lombok.jar", +# "-data", +# eclipse_workspace, +# "--add-modules=ALL-SYSTEM", +# }, +# root_dir = root_dir, +# init_options = { +# workspaceFolders = ws_folders_jdtls, +# }, +# settings = { +# java = { +# signatureHelp = { enabled = true}, +# completion = { enabled = true }, +# }, +# }, +# on_attach = function(client, bufnr) +# local opts = { silent = true, buffer = bufnr } +# vim.keymap.set('n', "lo", jdtls.organize_imports, { desc = 'Organize imports', buffer = bufnr }) +# vim.keymap.set('n', "df", jdtls.test_class, opts) +# vim.keymap.set('n', "dn", jdtls.test_nearest_method, opts) +# vim.keymap.set('n', 'rv', jdtls.extract_variable_all, { desc = 'Extract variable', buffer = bufnr }) +# vim.keymap.set('n', 'rc', jdtls.extract_constant, { desc = 'Extract constant', buffer = bufnr }) +# end +# } +# +# jdtls.start_or_attach(config) +# ''; + diff --git a/pkgs/nvim/config/languages/nvim-lint.nix b/pkgs/nvim/config/languages/nvim-lint.nix new file mode 100644 index 0000000..db8f109 --- /dev/null +++ b/pkgs/nvim/config/languages/nvim-lint.nix @@ -0,0 +1,16 @@ +{ + plugins.lint = { + enable = true; + lintersByFt = { + nix = ["statix"]; + lua = ["selene"]; + python = ["flake8"]; + javascript = ["eslint_d"]; + javascriptreact = ["eslint_d"]; + typescript = ["eslint_d"]; + typescriptreact = ["eslint_d"]; + json = ["jsonlint"]; + java = ["checkstyle"]; + }; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/treesitter-context.nix b/pkgs/nvim/config/languages/treesitter/treesitter-context.nix new file mode 100644 index 0000000..b588c8f --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/treesitter-context.nix @@ -0,0 +1,5 @@ +{ + plugins.treesitter-context = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix b/pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix new file mode 100644 index 0000000..29820cf --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix @@ -0,0 +1,50 @@ +{ + plugins.treesitter-textobjects = { + enable = false; + select = { + enable = true; + lookahead = true; + keymaps = { + "aa" = "@parameter.outer"; + "ia" = "@parameter.inner"; + "af" = "@function.outer"; + "if" = "@function.inner"; + "ac" = "@class.outer"; + "ic" = "@class.inner"; + "ii" = "@conditional.inner"; + "ai" = "@conditional.outer"; + "il" = "@loop.inner"; + "al" = "@loop.outer"; + "at" = "@comment.outer"; + }; + }; + move = { + enable = true; + gotoNextStart = { + "]m" = "@function.outer"; + "]]" = "@class.outer"; + }; + gotoNextEnd = { + "]M" = "@function.outer"; + "][" = "@class.outer"; + }; + gotoPreviousStart = { + "[m" = "@function.outer"; + "[[" = "@class.outer"; + }; + gotoPreviousEnd = { + "[M" = "@function.outer"; + "[]" = "@class.outer"; + }; + }; + swap = { + enable = true; + swapNext = { + "a" = "@parameters.inner"; + }; + swapPrevious = { + "A" = "@parameter.outer"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/treesitter.nix b/pkgs/nvim/config/languages/treesitter/treesitter.nix new file mode 100644 index 0000000..8ff420f --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/treesitter.nix @@ -0,0 +1,8 @@ +{ + plugins.treesitter = { + enable = true; + indent = true; + folding = true; + nixvimInjections = true; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/ts-autotag.nix b/pkgs/nvim/config/languages/treesitter/ts-autotag.nix new file mode 100644 index 0000000..9fa6d84 --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/ts-autotag.nix @@ -0,0 +1,5 @@ +{ + plugins.ts-autotag = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix b/pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix new file mode 100644 index 0000000..aad1ce0 --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix @@ -0,0 +1,6 @@ +{ + plugins.ts-context-commentstring = { + enable = true; + disableAutoInitialization = false; + }; +} diff --git a/pkgs/nvim/config/languages/typescript-tools-nvim.nix b/pkgs/nvim/config/languages/typescript-tools-nvim.nix new file mode 100644 index 0000000..8134073 --- /dev/null +++ b/pkgs/nvim/config/languages/typescript-tools-nvim.nix @@ -0,0 +1,47 @@ +{ + plugins.typescript-tools = { + enable = true; + onAttach = '' + function(client, bufnr) + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false + + if vim.lsp.inlay_hint then + vim.lsp.inlay_hint(bufnr, true) + end + end + ''; + settings = { + tsserverFilePreferences = { + # Inlay Hints + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayVariableTypeHints = true; + includeInlayVariableTypeHintsWhenTypeMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayEnumMemberValueHints = true; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "co"; + action = "TSToolsOrganizeImports"; + options = { + desc = "Organize Imports"; + }; + } + { + mode = "n"; + key = "cR"; + action = "TSToolsRemoveUnusedImports"; + options = { + desc = "Remove Unused Imports"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/lsp/conform.nix b/pkgs/nvim/config/lsp/conform.nix new file mode 100644 index 0000000..d252da6 --- /dev/null +++ b/pkgs/nvim/config/lsp/conform.nix @@ -0,0 +1,92 @@ +{ + plugins.conform-nvim = { + enable = true; + notifyOnError = true; + formattersByFt = { + html = [["prettierd" "prettier"]]; + css = [["prettierd" "prettier"]]; + javascript = [["prettierd" "prettier"]]; + javascriptreact = [["prettierd" "prettier"]]; + typescript = [["prettierd" "prettier"]]; + typescriptreact = [["prettierd" "prettier"]]; + java = ["google-java-format"]; + python = ["black"]; + lua = ["stylua"]; + nix = ["alejandra"]; + markdown = [["prettierd" "prettier"]]; + rust = ["rustfmt"]; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "uf"; + action = ":FormatToggle"; + options = { + desc = "Toggle Format"; + silent = true; + }; + } + { + mode = "n"; + key = "cf"; + action = "lua require('conform').format()"; + options = { + silent = true; + desc = "Format Buffer"; + }; + } + + { + mode = "v"; + key = "cF"; + action = "lua require('conform').format()"; + options = { + silent = true; + desc = "Format Lines"; + }; + } + ]; + + extraConfigLua = '' + local conform = require("conform") + local notify = require("notify") + + conform.setup({ + format_on_save = function(bufnr) + -- Disable with a global or buffer-local variable + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + return { timeout_ms = 500, lsp_fallback = true } + end, + }) + + local function show_notification(message, level) + notify(message, level, { title = "conform.nvim" }) + end + + vim.api.nvim_create_user_command("FormatToggle", function(args) + local is_global = not args.bang + if is_global then + vim.g.disable_autoformat = not vim.g.disable_autoformat + if vim.g.disable_autoformat then + show_notification("Autoformat-on-save disabled globally", "info") + else + show_notification("Autoformat-on-save enabled globally", "info") + end + else + vim.b.disable_autoformat = not vim.b.disable_autoformat + if vim.b.disable_autoformat then + show_notification("Autoformat-on-save disabled for this buffer", "info") + else + show_notification("Autoformat-on-save enabled for this buffer", "info") + end + end + end, { + desc = "Toggle autoformat-on-save", + bang = true, + }) + ''; +} diff --git a/pkgs/nvim/config/lsp/fidget.nix b/pkgs/nvim/config/lsp/fidget.nix new file mode 100644 index 0000000..868f386 --- /dev/null +++ b/pkgs/nvim/config/lsp/fidget.nix @@ -0,0 +1,99 @@ +{ + plugins.fidget = { + enable = true; + logger = { + level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace” + floatPrecision = 0.01; # Limit the number of decimals displayed for floats + }; + progress = { + pollRate = 0; # How and when to poll for progress messages + suppressOnInsert = true; # Suppress new messages while in insert mode + ignoreDoneAlready = false; # Ignore new tasks that are already complete + ignoreEmptyMessage = false; # Ignore new tasks that don't contain a message + clearOnDetach = + # Clear notification group when LSP server detaches + '' + function(client_id) + local client = vim.lsp.get_client_by_id(client_id) + return client and client.name or nil + end + ''; + notificationGroup = + # How to get a progress message's notification group key + '' + function(msg) return msg.lsp_client.name end + ''; + ignore = []; # List of LSP servers to ignore + lsp = { + progressRingbufSize = 0; # Configure the nvim's LSP progress ring buffer size + }; + display = { + renderLimit = 16; # How many LSP messages to show at once + doneTtl = 3; # How long a message should persist after completion + doneIcon = "✔"; # Icon shown when all LSP progress tasks are complete + doneStyle = "Constant"; # Highlight group for completed LSP tasks + progressTtl = "math.huge"; # How long a message should persist when in progress + progressIcon = { + pattern = "dots"; + period = 1; + }; # Icon shown when LSP progress tasks are in progress + progressStyle = "WarningMsg"; # Highlight group for in-progress LSP tasks + groupStyle = "Title"; # Highlight group for group name (LSP server name) + iconStyle = "Question"; # Highlight group for group icons + priority = 30; # Ordering priority for LSP notification group + skipHistory = true; # Whether progress notifications should be omitted from history + formatMessage = '' + require ("fidget.progress.display").default_format_message + ''; # How to format a progress message + formatAnnote = '' + function (msg) return msg.title end + ''; # How to format a progress annotation + formatGroupName = '' + function (group) return tostring (group) end + ''; # How to format a progress notification group's name + overrides = { + rust_analyzer = { + name = "rust-analyzer"; + }; + }; # Override options from the default notification config + }; + }; + notification = { + pollRate = 10; # How frequently to update and render notifications + filter = "info"; # “off”, “error”, “warn”, “info”, “debug”, “trace” + historySize = 128; # Number of removed messages to retain in history + overrideVimNotify = true; + redirect = '' + function(msg, level, opts) + if opts and opts.on_open then + return require("fidget.integration.nvim-notify").delegate(msg, level, opts) + end + end + ''; + configs = { + default = "require('fidget.notification').default_config"; + }; + + window = { + normalHl = "Comment"; + winblend = 0; + border = "none"; # none, single, double, rounded, solid, shadow + zindex = 45; + maxWidth = 0; + maxHeight = 0; + xPadding = 1; + yPadding = 0; + align = "bottom"; + relative = "editor"; + }; + view = { + stackUpwards = true; # Display notification items from bottom to top + iconSeparator = " "; # Separator between group name and icon + groupSeparator = "---"; # Separator between notification groups + groupSeparatorHl = + # Highlight group used for group separator + "Comment"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/lsp/lsp.nix b/pkgs/nvim/config/lsp/lsp.nix new file mode 100644 index 0000000..4568642 --- /dev/null +++ b/pkgs/nvim/config/lsp/lsp.nix @@ -0,0 +1,167 @@ +{ + plugins = { + lsp-format = { + enable = false; # Enable it if you want lsp-format integration for none-ls + }; + lsp = { + enable = true; + capabilities = "offsetEncoding = 'utf-16'"; + servers = { + clangd = {enable = true;}; + lua-ls = { + enable = true; + extraOptions = { + settings = { + Lua = { + completion = { + callSnippet = "Replace"; + }; + telemetry = { + enabled = false; + }; + hint = {enable = true;}; + }; + }; + }; + }; + nil_ls = {enable = true;}; + tsserver = { + enable = false; + filetypes = ["javascript" "javascriptreact" "typescript" "typescriptreact"]; + extraOptions = { + settings = { + javascript = { + inlayHints = { + includeInlayEnumMemberValueHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayVariableTypeHints = true; + }; + }; + typescript = { + inlayHints = { + includeInlayEnumMemberValueHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayVariableTypeHints = true; + }; + }; + }; + }; + }; + eslint = {enable = true;}; + pyright = {enable = true;}; + ruff-lsp = {enable = true;}; + + rust-analyzer = { + enable = true; + installCargo = true; + installRustc = true; + settings = { + checkOnSave = true; + check = { + command = "clippy"; + }; + # inlayHints = { + # enable = true; + # showParameterNames = true; + # parameterHintsPrefix = "<- "; + # otherHintsPrefix = "=> "; + # }; + procMacro = { + enable = true; + }; + }; + }; + }; + # keymaps = { + # silent = true; + # lspBuf = { + # gd = { + # action = "definition"; + # desc = "Goto Definition"; + # }; + # gr = { + # action = "references"; + # desc = "Goto References"; + # }; + # gD = { + # action = "declaration"; + # desc = "Goto Declaration"; + # }; + # gI = { + # action = "implementation"; + # desc = "Goto Implementation"; + # }; + # gT = { + # action = "type_definition"; + # desc = "Type Definition"; + # }; + # K = { + # action = "hover"; + # desc = "Hover"; + # }; + # "cw" = { + # action = "workspace_symbol"; + # desc = "Workspace Symbol"; + # }; + # "cr" = { + # action = "rename"; + # desc = "Rename"; + # }; + # "ca" = { + # action = "code_action"; + # desc = "Code Action"; + # }; + # "" = { + # action = "signature_help"; + # desc = "Signature Help"; + # }; + # }; + # diagnostic = { + # "cd" = { + # action = "open_float"; + # desc = "Line Diagnostics"; + # }; + # "[d" = { + # action = "goto_next"; + # desc = "Next Diagnostic"; + # }; + # "]d" = { + # action = "goto_prev"; + # desc = "Previous Diagnostic"; + # }; + # }; + # }; + }; + }; + extraConfigLua = '' + local _border = "rounded" + + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = _border + } + ) + + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + border = _border + } + ) + + vim.diagnostic.config{ + float={border=_border} + }; + + require('lspconfig.ui.windows').default_options = { + border = _border + } + ''; +} diff --git a/pkgs/nvim/config/lsp/lspsaga.nix b/pkgs/nvim/config/lsp/lspsaga.nix new file mode 100644 index 0000000..6fdf5d9 --- /dev/null +++ b/pkgs/nvim/config/lsp/lspsaga.nix @@ -0,0 +1,186 @@ +{ + plugins.lspsaga = { + enable = true; + beacon = { + enable = true; + }; + ui = { + border = "rounded"; # One of none, single, double, rounded, solid, shadow + codeAction = "💡"; # Can be any symbol you want 💡 + }; + hover = { + openCmd = "!floorp"; # Choose your browser + openLink = "gx"; + }; + diagnostic = { + borderFollow = true; + diagnosticOnlyCurrent = false; + showCodeAction = true; + }; + symbolInWinbar = { + enable = true; # Breadcrumbs + }; + codeAction = { + extendGitSigns = false; + showServerName = true; + onlyInCursor = true; + numShortcut = true; + keys = { + exec = ""; + quit = ["" "q"]; + }; + }; + lightbulb = { + enable = false; + sign = false; + virtualText = true; + }; + implement = { + enable = false; + }; + rename = { + autoSave = false; + keys = { + exec = ""; + quit = ["" ""]; + select = "x"; + }; + }; + outline = { + autoClose = true; + autoPreview = true; + closeAfterJump = true; + layout = "normal"; # normal or float + winPosition = "right"; # left or right + keys = { + jump = "e"; + quit = "q"; + toggleOrJump = "o"; + }; + }; + scrollPreview = { + scrollDown = ""; + scrollUp = ""; + }; + }; + keymaps = [ + { + mode = "n"; + key = "gd"; + action = "Lspsaga finder def"; + options = { + desc = "Goto Definition"; + silent = true; + }; + } + { + mode = "n"; + key = "gr"; + action = "Lspsaga finder ref"; + options = { + desc = "Goto References"; + silent = true; + }; + } + + # { + # mode = "n"; + # key = "gD"; + # action = "Lspsaga show_line_diagnostics"; + # options = { + # desc = "Goto Declaration"; + # silent = true; + # }; + # } + + { + mode = "n"; + key = "gI"; + action = "Lspsaga finder imp"; + options = { + desc = "Goto Implementation"; + silent = true; + }; + } + + { + mode = "n"; + key = "gT"; + action = "Lspsaga peek_type_definition"; + options = { + desc = "Type Definition"; + silent = true; + }; + } + + { + mode = "n"; + key = "K"; + action = "Lspsaga hover_doc"; + options = { + desc = "Hover"; + silent = true; + }; + } + + { + mode = "n"; + key = "cw"; + action = "Lspsaga outline"; + options = { + desc = "Outline"; + silent = true; + }; + } + + { + mode = "n"; + key = "cr"; + action = "Lspsaga rename"; + options = { + desc = "Rename"; + silent = true; + }; + } + + { + mode = "n"; + key = "ca"; + action = "Lspsaga code_action"; + options = { + desc = "Code Action"; + silent = true; + }; + } + + { + mode = "n"; + key = "cd"; + action = "Lspsaga show_line_diagnostics"; + options = { + desc = "Line Diagnostics"; + silent = true; + }; + } + + { + mode = "n"; + key = "[d"; + action = "Lspsaga diagnostic_jump_next"; + options = { + desc = "Next Diagnostic"; + silent = true; + }; + } + + { + mode = "n"; + key = "]d"; + action = "Lspsaga diagnostic_jump_prev"; + options = { + desc = "Previous Diagnostic"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/lsp/trouble.nix b/pkgs/nvim/config/lsp/trouble.nix new file mode 100644 index 0000000..783aa08 --- /dev/null +++ b/pkgs/nvim/config/lsp/trouble.nix @@ -0,0 +1,52 @@ +{ + plugins.trouble = { + enable = true; + settings = { + auto_close = true; + }; + }; + # TODO: Add keybinds to close trouble (q would be nice), rn I need to use :x to close it... + keymaps = [ + { + mode = "n"; + key = "x"; + action = "+diagnostics/quickfix"; + } + { + mode = "n"; + key = "xx"; + action = "TroubleToggle"; + options = { + silent = true; + desc = "Document Diagnostics (Trouble)"; + }; + } + { + mode = "n"; + key = "xX"; + action = "TroubleToggle workspace_diagnostics"; + options = { + silent = true; + desc = "Workspace Diagnostics (Trouble)"; + }; + } + { + mode = "n"; + key = "xt"; + action = "TroubleToggle todo"; + options = { + silent = true; + desc = "Todo (Trouble)"; + }; + } + { + mode = "n"; + key = "xQ"; + action = "TodoQuickFix"; + options = { + silent = true; + desc = "Quickfix List (Trouble)"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/none-ls/none-ls.nix b/pkgs/nvim/config/none-ls/none-ls.nix new file mode 100644 index 0000000..5eaaf6d --- /dev/null +++ b/pkgs/nvim/config/none-ls/none-ls.nix @@ -0,0 +1,73 @@ +{ + plugins.none-ls = { + enable = false; + enableLspFormat = false; + updateInInsert = false; + onAttach = '' + function(client, bufnr) + if client.supports_method "textDocument/formatting" then + vim.api.nvim_clear_autocmds { group = augroup, buffer = bufnr } + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + vim.lsp.buf.format { bufnr = bufnr } + end, + }) + end + end + ''; + sources = { + code_actions = { + gitsigns.enable = true; + statix.enable = true; + }; + diagnostics = { + checkstyle = { + enable = true; + }; + statix = { + enable = true; + }; + }; + formatting = { + alejandra = { + enable = true; + }; + prettier = { + enable = true; + withArgs = '' + { + extra_args = { "--no-semi", "--single-quote" }, + } + ''; + }; + google_java_format = { + enable = true; + }; + stylua = { + enable = true; + }; + black = { + enable = true; + withArgs = '' + { + extra_args = { "--fast" }, + } + ''; + }; + }; + }; + }; + # keymaps = [ + # { + # mode = [ "n" "v" ]; + # key = "cf"; + # action = "lua vim.lsp.buf.format()"; + # options = { + # silent = true; + # desc = "Format"; + # }; + # } + # ]; +} diff --git a/pkgs/nvim/config/sets.nix b/pkgs/nvim/config/sets.nix new file mode 100644 index 0000000..d50f286 --- /dev/null +++ b/pkgs/nvim/config/sets.nix @@ -0,0 +1,145 @@ +{ + pkgs, + lib, + config, + ... +}: { + config = { + opts = { + # Enable relative line numbers + number = true; + relativenumber = true; + + # Set tabs to 2 spaces + tabstop = 2; + softtabstop = 2; + showtabline = 2; + expandtab = true; + + # Enable auto indenting and set it to spaces + smartindent = true; + shiftwidth = 2; + + # Enable smart indenting (see https://stackoverflow.com/questions/1204149/smart-wrap-in-vim) + breakindent = true; + + # Enable incremental searching + hlsearch = true; + incsearch = true; + + # Enable text wrap + wrap = true; + + # Better splitting + splitbelow = true; + splitright = true; + + # Enable mouse mode + mouse = "a"; # Mouse + + # Enable ignorecase + smartcase for better searching + ignorecase = true; + smartcase = true; # Don't ignore case with capitals + grepprg = "rg --vimgrep"; + grepformat = "%f:%l:%c:%m"; + + # Decrease updatetime + updatetime = 50; # faster completion (4000ms default) + + # Set completeopt to have a better completion experience + completeopt = ["menuone" "noselect" "noinsert"]; # mostly just for cmp + + # Enable persistent undo history + swapfile = false; + backup = false; + undofile = true; + + # Enable 24-bit colors + termguicolors = true; + + # Enable the sign column to prevent the screen from jumping + signcolumn = "yes"; + + # Enable cursor line highlight + cursorline = true; # Highlight the line where the cursor is located + + # Set fold settings + # These options were reccommended by nvim-ufo + # See: https://github.com/kevinhwang91/nvim-ufo#minimal-configuration + foldcolumn = "0"; + foldlevel = 99; + foldlevelstart = 99; + foldenable = true; + + # Always keep 8 lines above/below cursor unless at start/end of file + scrolloff = 8; + + # Place a column line + colorcolumn = "80"; + + # Reduce which-key timeout to 10ms + timeoutlen = 10; + + # Set encoding type + encoding = "utf-8"; + fileencoding = "utf-8"; + + # Change cursor options + guicursor = [ + "n-v-c:block" # Normal, visual, command-line: block cursor + "i-ci-ve:block" # Insert, command-line insert, visual-exclude: vertical bar cursor with block cursor, use "ver25" for 25% width + "r-cr:hor20" # Replace, command-line replace: horizontal bar cursor with 20% height + "o:hor50" # Operator-pending: horizontal bar cursor with 50% height + "a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor" # All modes: blinking settings + "sm:block-blinkwait175-blinkoff150-blinkon175" # Showmatch: block cursor with specific blinking settings + ]; + + # Enable chars list + list = true; # Show invisible characters (tabs, eol, ...) + listchars = "eol:↲,tab:|->,lead:·,space: ,trail:•,extends:→,precedes:←,nbsp:␣"; + + # More space in the neovim command line for displaying messages + cmdheight = 2; + + # We don't need to see things like INSERT anymore + showmode = false; + + # Maximum number of items to show in the popup menu (0 means "use available screen space") + pumheight = 0; + + # Use conform-nvim for gq formatting. ('formatexpr' is set to vim.lsp.formatexpr(), so you can format lines via gq if the language server supports it) + formatexpr = "v:lua.require'conform'.formatexpr()"; + + laststatus = 3; # (https://neovim.io/doc/user/options.html#'laststatus') + }; + + extraConfigLua = '' + local opt = vim.opt + local g = vim.g + local o = vim.o + -- Neovide + if g.neovide then + -- Neovide options + g.neovide_fullscreen = false + g.neovide_hide_mouse_when_typing = false + g.neovide_refresh_rate = 165 + g.neovide_cursor_vfx_mode = "ripple" + g.neovide_cursor_animate_command_line = true + g.neovide_cursor_animate_in_insert_mode = true + g.neovide_cursor_vfx_particle_lifetime = 5.0 + g.neovide_cursor_vfx_particle_density = 14.0 + g.neovide_cursor_vfx_particle_speed = 12.0 + g.neovide_transparency = 0.8 + + -- Neovide Fonts + o.guifont = "MonoLisa Trial:Medium:h15" + -- o.guifont = "CommitMono:Medium:h15" + -- o.guifont = "JetBrainsMono Nerd Font:h14:Medium:i" + -- o.guifont = "FiraMono Nerd Font:Medium:h14" + -- o.guifont = "CaskaydiaCove Nerd Font:h14:b:i" + -- o.guifont = "BlexMono Nerd Font Mono:h14:Medium:i" + -- o.guifont = "Liga SFMono Nerd Font:b:h15" + end + ''; + }; +} diff --git a/pkgs/nvim/config/snippets/luasnip.nix b/pkgs/nvim/config/snippets/luasnip.nix new file mode 100644 index 0000000..02d9ee0 --- /dev/null +++ b/pkgs/nvim/config/snippets/luasnip.nix @@ -0,0 +1,19 @@ +{ + pkgs, + config, + ... +}: { + plugins.luasnip = { + enable = true; + extraConfig = { + enable_autosnippets = true; + store_selection_keys = ""; + }; + fromVscode = [ + { + lazyLoad = true; + paths = "${pkgs.vimPlugins.friendly-snippets}"; + } + ]; + }; +} diff --git a/pkgs/nvim/config/statusline/lualine.nix b/pkgs/nvim/config/statusline/lualine.nix new file mode 100644 index 0000000..1a2d424 --- /dev/null +++ b/pkgs/nvim/config/statusline/lualine.nix @@ -0,0 +1,33 @@ +{ + plugins.lualine = { + enable = false; + alwaysDivideMiddle = true; + globalstatus = true; + ignoreFocus = ["neo-tree"]; + extensions = ["fzf"]; + theme = "auto"; + componentSeparators = { + left = "|"; + right = "|"; + }; + sectionSeparators = { + left = "█"; #  + right = "█"; #  + }; + sections = { + lualine_a = ["mode"]; + lualine_b = [ + { + name = "branch"; + icon = ""; + } + "diff" + "diagnostics" + ]; + lualine_c = ["filename"]; + lualine_x = ["filetype"]; + lualine_y = ["progress"]; + lualine_z = [''" " .. os.date("%R")'']; + }; + }; +} diff --git a/pkgs/nvim/config/statusline/staline.nix b/pkgs/nvim/config/statusline/staline.nix new file mode 100644 index 0000000..ae07bb8 --- /dev/null +++ b/pkgs/nvim/config/statusline/staline.nix @@ -0,0 +1,65 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "staline.nvim"; + version = "2024-02-05"; + src = pkgs.fetchFromGitHub { + owner = "tamton-aquib"; + repo = "staline.nvim"; + rev = "a53f869278b8b186a5afd6f21680cd103c381599"; + hash = "sha256-GDMKzxFDtQk5LL+rMsxTGTyLv69w5NUd+u19noeO5ws="; + }; + }) + ]; + extraConfigLua = '' + require("staline").setup({ + sections = { + left = { "-mode", " ", "branch" }, + mid = { "lsp_name" }, + right = { "file_name", "line_column" }, + }, + inactive_sections = { + left = { "-mode", " ", "branch" }, + mid = { "lsp_name" }, + right = { "file_name", "line_column" }, + }, + defaults = { + left_separator = " ", + right_separator = " ", + branch_symbol = " ", + mod_symbol = "", + line_column = "[%l/%L]", + inactive_color = "#80a6f2", --#303030 is the default + inactive_bgcolor = "none", + }, + special_table = { + lazy = { "Plugins", "💤 " }, + TelescopePrompt = { "Telescope", " " }, + oil = { "Oil", "󰏇 " }, + lazygit = { "LazyGit", " " }, + }, + mode_icons = { + ["n"] = "NORMAL", + ["no"] = "NORMAL", + ["nov"] = "NORMAL", + ["noV"] = "NORMAL", + ["niI"] = "NORMAL", + ["niR"] = "NORMAL", + ["niV"] = "NORMAL", + ["i"] = "INSERT", + ["ic"] = "INSERT", + ["ix"] = "INSERT", + ["s"] = "INSERT", + ["S"] = "INSERT", + ["v"] = "VISUAL", + ["V"] = "VISUAL", + [""] = "VISUAL", + ["r"] = "REPLACE", + ["r?"] = "REPLACE", + ["R"] = "REPLACE", + ["c"] = "COMMAND", + ["t"] = "TERMINAL", + }, + }) + ''; +} diff --git a/pkgs/nvim/config/telescope/telescope.nix b/pkgs/nvim/config/telescope/telescope.nix new file mode 100644 index 0000000..508521c --- /dev/null +++ b/pkgs/nvim/config/telescope/telescope.nix @@ -0,0 +1,178 @@ +{ + plugins.telescope = { + enable = true; + + extensions = { + fzf-native = { + enable = true; + }; + ui-select = { + settings = { + specific_opts = { + codeactions = true; + }; + }; + }; + undo = { + enable = true; + }; + }; + # If you'd prefer Telescope not to enter a normal-like mode when hitting escape (and instead exiting), you can map to do so via: + settings = { + defaults = { + mappings = { + i = { + "" = { + __raw = '' + function(...) + return require("telescope.actions").close(...) + end''; + }; + }; + }; + }; + }; + keymaps = { + "" = { + action = "find_files, {}"; + options.desc = "Find project files"; + }; + "/" = { + action = "live_grep"; + options.desc = "Grep (root dir)"; + }; + ":" = { + action = "command_history, {}"; + options.desc = "Command History"; + }; + "b" = { + action = "buffers, {}"; + options.desc = "+buffer"; + }; + "ff" = { + action = "find_files, {}"; + options.desc = "Find project files"; + }; + "fr" = { + action = "oldfiles, {}"; + options.desc = "Recent"; + }; + "fb" = { + action = "buffers, {}"; + options.desc = "Buffers"; + }; + "" = { + action = "git_files, {}"; + options.desc = "Search git files"; + }; + "gc" = { + action = "git_commits, {}"; + options.desc = "Commits"; + }; + "gs" = { + action = "git_status, {}"; + options.desc = "Status"; + }; + "sa" = { + action = "autocommands, {}"; + options.desc = "Auto Commands"; + }; + "sb" = { + action = "current_buffer_fuzzy_find, {}"; + options.desc = "Buffer"; + }; + "sc" = { + action = "command_history, {}"; + options.desc = "Command History"; + }; + "sC" = { + action = "commands, {}"; + options.desc = "Commands"; + }; + "sD" = { + action = "diagnostics, {}"; + options.desc = "Workspace diagnostics"; + }; + "sh" = { + action = "help_tags, {}"; + options.desc = "Help pages"; + }; + "sH" = { + action = "highlights, {}"; + options.desc = "Search Highlight Groups"; + }; + "sk" = { + action = "keymaps, {}"; + options.desc = "Keymaps"; + }; + "sM" = { + action = "man_pages, {}"; + options.desc = "Man pages"; + }; + "sm" = { + action = "marks, {}"; + options.desc = "Jump to Mark"; + }; + "so" = { + action = "vim_options, {}"; + options.desc = "Options"; + }; + "sR" = { + action = "resume, {}"; + options.desc = "Resume"; + }; + "uC" = { + action = "colorscheme, {}"; + options.desc = "Colorscheme preview"; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "fp"; + action = "Telescope projects"; + options = { + desc = "Projects"; + }; + } + + { + mode = "n"; + key = "sd"; + action = "Telescope diagnostics bufnr=0"; + options = { + desc = "Document diagnostics"; + }; + } + + { + mode = "n"; + key = "st"; + action = "TodoTelescope"; + options = { + silent = true; + desc = "Todo (Telescope)"; + }; + } + + # { + # mode = "n"; + # key = ","; + # action = "Telescope buffers sort_mru=true sort_lastused=true"; + # options = { + # desc = "Switch Buffer"; + # }; + # } + ]; + extraConfigLua = '' + local telescope = require('telescope') + telescope.setup{ + pickers = { + colorscheme = { + enable_preview = true + } + } + } + ''; +} diff --git a/pkgs/nvim/config/ui/alpha.nix b/pkgs/nvim/config/ui/alpha.nix new file mode 100644 index 0000000..69658ae --- /dev/null +++ b/pkgs/nvim/config/ui/alpha.nix @@ -0,0 +1,191 @@ +{ + plugins.alpha = { + enable = true; + theme = null; + iconsEnabled = true; + layout = let + padding = val: { + type = "padding"; + inherit val; + }; + in [ + (padding 4) + { + opts = { + hl = "AlphaHeader"; + position = "center"; + }; + type = "text"; + val = [ + " ██▀███ ▓█████ ▓█████▄▓██ ██▓ █████▒ " + " ▓██ ▒ ██▒▓█ ▀ ▒██▀ ██▌▒██ ██▒▓██ ▒ " + " ▓██ ░▄█ ▒▒███ ░██ █▌ ▒██ ██░▒████ ░ " + " ▒██▀▀█▄ ▒▓█ ▄ ░▓█▄ ▌ ░ ▐██▓░░▓█▒ ░ " + " ░██▓ ▒██▒░▒████▒░▒████▓ ░ ██▒▓░░▒█░ " + " ░ ▒▓ ░▒▓░░░ ▒░ ░ ▒▒▓ ▒ ██▒▒▒ ▒ ░ " + " ░▒ ░ ▒░ ░ ░ ░ ░ ▒ ▒ ▓██ ░▒░ ░ " + " ░░ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░ ░ " + " ░ ░ ░ ░ ░ ░ " + " " + " git@github.com:redyf " + ]; + } + (padding 2) + { + type = "button"; + val = " Find File"; + on_press.raw = "require('telescope.builtin').find_files"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "f" + ":Telescope find_files " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "f"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = " New File"; + on_press.__raw = "function() vim.cmd[[ene]] end"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "n" + ":ene startinsert " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "n"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = "󰈚 Recent Files"; + on_press.raw = "require('telescope.builtin').oldfiles"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "r" + ":Telescope oldfiles " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "r"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = "󰈭 Find Word"; + on_press.raw = "require('telescope.builtin').live_grep"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "g" + ":Telescope live_grep " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "g"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = " Restore Session"; + on_press.raw = "require('persistence').load()"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "s" + ":lua require('persistence').load()" + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "s"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = " Quit Neovim"; + on_press.__raw = "function() vim.cmd[[qa]] end"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "q" + ":qa" + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "q"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + ]; + }; +} diff --git a/pkgs/nvim/config/ui/dressing-nvim.nix b/pkgs/nvim/config/ui/dressing-nvim.nix new file mode 100644 index 0000000..9f4374b --- /dev/null +++ b/pkgs/nvim/config/ui/dressing-nvim.nix @@ -0,0 +1,171 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + dressing-nvim + ]; + extraConfigLua = '' + require("dressing").setup({ + input = { + -- Set to false to disable the vim.ui.input implementation + enabled = true, + + -- Default prompt string + default_prompt = "Input", + + -- Trim trailing `:` from prompt + trim_prompt = true, + + -- Can be 'left', 'right', or 'center' + title_pos = "left", + + -- When true, will close the modal + insert_only = true, + + -- When true, input will start in insert mode. + start_in_insert = true, + + -- These are passed to nvim_open_win + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "cursor", + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + prefer_width = 40, + width = nil, + -- min_width and max_width can be a list of mixed types. + -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" + max_width = { 140, 0.9 }, + min_width = { 20, 0.2 }, + + buf_options = {}, + win_options = { + -- Disable line wrapping + wrap = false, + -- Indicator for when text exceeds window + list = true, + listchars = "precedes:…,extends:…", + -- Increase this for more context when text scrolls off the window + sidescrolloff = 0, + }, + + -- Set to `false` to disable + mappings = { + n = { + [""] = "Close", + [""] = "Confirm", + }, + i = { + [""] = "Close", + [""] = "Confirm", + [""] = "HistoryPrev", + [""] = "HistoryNext", + }, + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + + -- see :help dressing_get_config + get_config = nil, + }, + select = { + -- Set to false to disable the vim.ui.select implementation + enabled = true, + + -- Priority list of preferred vim.select implementations + backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, + + -- Trim trailing `:` from prompt + trim_prompt = true, + + -- Options for telescope selector + -- These are passed into the telescope picker directly. Can be used like: + -- telescope = require('telescope.themes').get_ivy({...}) + telescope = nil, + + -- Options for fzf selector + fzf = { + window = { + width = 0.5, + height = 0.4, + }, + }, + + -- Options for fzf-lua + fzf_lua = { + -- winopts = { + -- height = 0.5, + -- width = 0.5, + -- }, + }, + + -- Options for nui Menu + nui = { + position = "50%", + size = nil, + relative = "editor", + border = { + style = "rounded", + }, + buf_options = { + swapfile = false, + filetype = "DressingSelect", + }, + win_options = { + winblend = 0, + }, + max_width = 80, + max_height = 40, + min_width = 40, + min_height = 10, + }, + + -- Options for built-in selector + builtin = { + -- Display numbers for options and set up keymaps + show_numbers = true, + -- These are passed to nvim_open_win + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "editor", + + buf_options = {}, + win_options = { + cursorline = true, + cursorlineopt = "both", + }, + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- the min_ and max_ options can be a list of mixed types. + -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" + width = nil, + max_width = { 140, 0.8 }, + min_width = { 40, 0.2 }, + height = nil, + max_height = 0.9, + min_height = { 10, 0.2 }, + + -- Set to `false` to disable + mappings = { + [""] = "Close", + [""] = "Close", + [""] = "Confirm", + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + }, + + -- Used to override format_item. See :help dressing-format + format_item_override = {}, + + -- see :help dressing_get_config + get_config = nil, + }, + }) ''; +} diff --git a/pkgs/nvim/config/ui/indent-blankline.nix b/pkgs/nvim/config/ui/indent-blankline.nix new file mode 100644 index 0000000..1c382c8 --- /dev/null +++ b/pkgs/nvim/config/ui/indent-blankline.nix @@ -0,0 +1,32 @@ +{ + plugins = { + indent-blankline = { + enable = true; + settings = { + indent = { + char = "│"; # "│" or "▎" + }; + scope = { + enabled = true; + show_start = true; + }; + exclude = { + buftypes = ["terminal" "nofile"]; + filetypes = [ + "help" + "alpha" + "dashboard" + "neo-tree" + "Trouble" + "trouble" + "lazy" + "mason" + "notify" + "toggleterm" + "lazyterm" + ]; + }; + }; + }; + }; +} diff --git a/pkgs/nvim/config/ui/noice.nix b/pkgs/nvim/config/ui/noice.nix new file mode 100644 index 0000000..51db89d --- /dev/null +++ b/pkgs/nvim/config/ui/noice.nix @@ -0,0 +1,36 @@ +{ + plugins.noice = { + enable = true; + notify = { + enabled = false; + }; + messages = { + enabled = true; # Adds a padding-bottom to neovim statusline when set to false for some reason + }; + lsp = { + message = { + enabled = true; + }; + progress = { + enabled = false; + view = "mini"; + }; + }; + popupmenu = { + enabled = true; + backend = "nui"; + }; + format = { + filter = { + pattern = [":%s*%%s*s:%s*" ":%s*%%s*s!%s*" ":%s*%%s*s/%s*" "%s*s:%s*" ":%s*s!%s*" ":%s*s/%s*"]; + icon = ""; + lang = "regex"; + }; + replace = { + pattern = [":%s*%%s*s:%w*:%s*" ":%s*%%s*s!%w*!%s*" ":%s*%%s*s/%w*/%s*" "%s*s:%w*:%s*" ":%s*s!%w*!%s*" ":%s*s/%w*/%s*"]; + icon = "󱞪"; + lang = "regex"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/ui/nui.nix b/pkgs/nvim/config/ui/nui.nix new file mode 100644 index 0000000..f2710a3 --- /dev/null +++ b/pkgs/nvim/config/ui/nui.nix @@ -0,0 +1,3 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [nui-nvim]; +} diff --git a/pkgs/nvim/config/ui/nvim-notify.nix b/pkgs/nvim/config/ui/nvim-notify.nix new file mode 100644 index 0000000..30441ce --- /dev/null +++ b/pkgs/nvim/config/ui/nvim-notify.nix @@ -0,0 +1,44 @@ +{ + plugins.notify = { + enable = true; + backgroundColour = "#000000"; + fps = 60; + render = "default"; + timeout = 500; + topDown = true; + }; + keymaps = [ + { + mode = "n"; + key = "un"; + action = '' + lua require("notify").dismiss({ silent = true, pending = true }) + ''; + options = { + desc = "Dismiss All Notifications"; + }; + } + ]; + extraConfigLua = '' + local notify = require("notify") + local filtered_message = { "No information available" } + + -- Override notify function to filter out messages + ---@diagnostic disable-next-line: duplicate-set-field + vim.notify = function(message, level, opts) + local merged_opts = vim.tbl_extend("force", { + on_open = function(win) + local buf = vim.api.nvim_win_get_buf(win) + vim.api.nvim_buf_set_option(buf, "filetype", "markdown") + end, + }, opts or {}) + + for _, msg in ipairs(filtered_message) do + if message == msg then + return + end + end + return notify(message, level, merged_opts) + end + ''; +} diff --git a/pkgs/nvim/config/utils/better-escape.nix b/pkgs/nvim/config/utils/better-escape.nix new file mode 100644 index 0000000..22b136c --- /dev/null +++ b/pkgs/nvim/config/utils/better-escape.nix @@ -0,0 +1,7 @@ +{ + plugins.better-escape = { + enable = true; + clearEmptyLines = true; + timeout = 200; + }; +} diff --git a/pkgs/nvim/config/utils/flash.nix b/pkgs/nvim/config/utils/flash.nix new file mode 100644 index 0000000..b531743 --- /dev/null +++ b/pkgs/nvim/config/utils/flash.nix @@ -0,0 +1,56 @@ +{ + plugins.flash = { + enable = false; + labels = "asdfghjklqwertyuiopzxcvbnm"; + search = { + mode = "fuzzy"; + }; + jump = { + autojump = true; + }; + label = { + uppercase = false; + rainbow = { + enabled = false; + shade = 5; + }; + }; + }; + # keymaps = [ + # { + # mode = [ "n" "x" "o" ]; + # key = "s"; + # action = "lua require('flash').jump()"; + # options = { + # desc = "Flash"; + # }; + # } + # + # { + # mode = [ "n" "x" "o" ]; + # key = "S"; + # action = "lua require('flash').treesitter()"; + # options = { + # desc = "Flash Treesitter"; + # }; + # } + # + # { + # mode = "o"; + # key = "r"; + # action = "lua require('flash').remote()"; + # options = { + # desc = "Remote Flash"; + # }; + # } + # + # { + # mode = [ "x" "o" ]; + # key = "R"; + # action = "lua require('flash').treesitter_search()"; + # options = { + # desc = "Treesitter Search"; + # }; + # } + # ]; +} diff --git a/pkgs/nvim/config/utils/hardtime.nix b/pkgs/nvim/config/utils/hardtime.nix new file mode 100644 index 0000000..e4bfef4 --- /dev/null +++ b/pkgs/nvim/config/utils/hardtime.nix @@ -0,0 +1,26 @@ +{ + plugins.hardtime = { + enable = true; + enabled = false; + disableMouse = true; + disabledFiletypes = ["neo-tree" "qf" "netrw" "NvimTree"]; + hint = true; + maxCount = 4; + maxTime = 1000; + restrictionMode = "hint"; + restrictedKeys = { + "h" = ["n" "x"]; + "j" = ["n" "x"]; + "k" = ["n" "x"]; + "l" = ["n" "x"]; + "-" = ["n" "x"]; + "+" = ["n" "x"]; + "gj" = ["n" "x"]; + "gk" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + }; + }; +} diff --git a/pkgs/nvim/config/utils/harpoon.nix b/pkgs/nvim/config/utils/harpoon.nix new file mode 100644 index 0000000..b55df68 --- /dev/null +++ b/pkgs/nvim/config/utils/harpoon.nix @@ -0,0 +1,17 @@ +{ + plugins.harpoon = { + enable = true; + enableTelescope = true; + keymapsSilent = true; + keymaps = { + addFile = "ha"; + toggleQuickMenu = ""; + navFile = { + "1" = "hj"; + "2" = "hk"; + "3" = "hl"; + "4" = "hm"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/utils/illuminate.nix b/pkgs/nvim/config/utils/illuminate.nix new file mode 100644 index 0000000..c05bc15 --- /dev/null +++ b/pkgs/nvim/config/utils/illuminate.nix @@ -0,0 +1,17 @@ +{ + plugins.illuminate = { + enable = false; + underCursor = false; + filetypesDenylist = [ + "DressingSelect" + "Outline" + "TelescopePrompt" + "alpha" + "harpoon" + "toggleterm" + "neo-tree" + "Spectre" + "reason" + ]; + }; +} diff --git a/pkgs/nvim/config/utils/markdown-preview.nix b/pkgs/nvim/config/utils/markdown-preview.nix new file mode 100644 index 0000000..00df5e6 --- /dev/null +++ b/pkgs/nvim/config/utils/markdown-preview.nix @@ -0,0 +1,19 @@ +{ + plugins.markdown-preview = { + enable = true; + settings = { + browser = "floorp"; + theme = "dark"; + }; + }; + keymaps = [ + { + mode = "n"; + key = "cp"; + action = "MarkdownPreview"; + options = { + desc = "Markdown Preview"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/mini.nix b/pkgs/nvim/config/utils/mini.nix new file mode 100644 index 0000000..f688f3f --- /dev/null +++ b/pkgs/nvim/config/utils/mini.nix @@ -0,0 +1,15 @@ +{ + plugins.mini = { + enable = true; + modules = { + comment = { + options = { + customCommentString = '' + lua require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring + ''; + }; + }; + cursorword = {}; + }; + }; +} diff --git a/pkgs/nvim/config/utils/neocord.nix b/pkgs/nvim/config/utils/neocord.nix new file mode 100644 index 0000000..2886367 --- /dev/null +++ b/pkgs/nvim/config/utils/neocord.nix @@ -0,0 +1,27 @@ +{ + plugins.neocord = { + enable = true; + settings = { + auto_update = true; + blacklist = []; + client_id = "1157438221865717891"; + debounce_timeout = 10; + editing_text = "Editing..."; + enable_line_number = true; + logo = "https://repository-images.githubusercontent.com/325421844/ecb73f47-cb89-4ee0-a0fd-9743c2f3569a"; + logo_tooltip = "NixVim"; + file_assets = null; + file_explorer_text = "Browsing..."; + git_commit_text = "Committing changes..."; + global_timer = true; + line_number_text = "Line %s out of %s"; + log_level = null; + main_image = "logo"; + plugin_manager_text = "Managing plugins..."; + reading_text = "Reading..."; + show_time = true; + terminal_text = "Using Terminal..."; + workspace_text = "Working on %s"; + }; + }; +} diff --git a/pkgs/nvim/config/utils/neodev.nix b/pkgs/nvim/config/utils/neodev.nix new file mode 100644 index 0000000..fa1619e --- /dev/null +++ b/pkgs/nvim/config/utils/neodev.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + neodev-nvim + ]; + + extraConfigLua = '' + require("neodev").setup({ + library = { plugins = {"neotest"}, types = true}, + }) + ''; +} diff --git a/pkgs/nvim/config/utils/neotest.nix b/pkgs/nvim/config/utils/neotest.nix new file mode 100644 index 0000000..5d25bcf --- /dev/null +++ b/pkgs/nvim/config/utils/neotest.nix @@ -0,0 +1,133 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + (pkgs.vimUtils.buildVimPlugin { + pname = "neotest-java"; + version = "v0.9.0"; + src = pkgs.fetchFromGitHub { + owner = "rcasia"; + repo = "neotest-java"; + rev = "2234bfa8044dc39a8baf90470747c65e4623a222"; + sha256 = "0w5fvqic3qapi9ggfb81nqa9fl6jv831s91r0wgn4d7c35h0340r"; + }; + }) + (pkgs.vimUtils.buildVimPlugin { + pname = "neotest-vim-test"; + version = "2023-04-17"; + src = pkgs.fetchFromGitHub { + owner = "nvim-neotest"; + repo = "neotest-vim-test"; + rev = "75c4228882ae4883b11bfce9b8383e637eb44192"; + sha256 = "12ix1lzmqlk3iyngaafby9c02fcl9d5iva965miwxfljvmibjnbw"; + }; + }) + neotest + FixCursorHold-nvim + neotest-plenary + vim-test + neotest-python + neotest-vitest + ]; + extraConfigLua = '' + require("neotest").setup({ + adapters = { + require("neotest-java")({ + ignore_wrapper = false, + -- function to determine which runner to use based on project path + determine_runner = function(project_root_path) + -- return should be "maven" or "gradle" + return "maven" + end, + -- override the builtin runner discovery behaviour to always use given + -- tool. Default is "nil", so no override + force_runner = nil, + -- if the automatic runner discovery can't uniquely determine whether + -- to use Gradle or Maven, fallback to using this runner. Default is + -- "maven" + fallback_runner = "gradle" + }), + require("neotest-python")({ + dap = { justMyCode = false }, + }), + require "neotest-vim-test" { + ignore_file_types = { "python", "java", "vim", "lua", "javascript", "typescript" }, + }, + }, + output = { enabled = true, open_on_run = true }, + summary = { enabled = true, }, + }) + ''; + keymaps = [ + { + mode = "n"; + key = "tt"; + action = "lua require('neotest').run.run(vim.fn.expand '%')"; + options = { + desc = "Run File"; + silent = true; + }; + } + { + mode = "n"; + key = "tT"; + action = "lua require('neotest').run.run(vim.loop.cwd())"; + options = { + desc = "Run All Test Files"; + silent = true; + }; + } + { + mode = "n"; + key = "tr"; + action = "lua require('neotest').run.run()"; + options = { + desc = "Run Nearest"; + silent = true; + }; + } + { + mode = "n"; + key = "td"; + action = "lua require('neotest').run.run({strategy = 'dap'})"; + options = { + desc = "Run Nearest with debugger"; + silent = true; + }; + } + { + mode = "n"; + key = "ts"; + action = "lua require('neotest').summary.toggle()"; + options = { + desc = "Toggle Summary"; + silent = true; + }; + } + { + mode = "n"; + key = "to"; + action = "lua require('neotest').output.open{ enter = true, auto_close = true }"; + options = { + desc = "Show Output"; + silent = true; + }; + } + { + mode = "n"; + key = "tO"; + action = "lua require('neotest').output_panel.toggle()"; + options = { + desc = "Toggle Output Panel"; + silent = true; + }; + } + { + mode = "n"; + key = "tS"; + action = "lua require('neotest').run.stop()"; + options = { + desc = "Stop"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/nvim-autopairs.nix b/pkgs/nvim/config/utils/nvim-autopairs.nix new file mode 100644 index 0000000..2af29dc --- /dev/null +++ b/pkgs/nvim/config/utils/nvim-autopairs.nix @@ -0,0 +1,5 @@ +{ + plugins.nvim-autopairs = { + enable = false; + }; +} diff --git a/pkgs/nvim/config/utils/nvim-colorizer.nix b/pkgs/nvim/config/utils/nvim-colorizer.nix new file mode 100644 index 0000000..81d8592 --- /dev/null +++ b/pkgs/nvim/config/utils/nvim-colorizer.nix @@ -0,0 +1,5 @@ +{ + plugins.nvim-colorizer = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/nvim-surround.nix b/pkgs/nvim/config/utils/nvim-surround.nix new file mode 100644 index 0000000..6a7f4b1 --- /dev/null +++ b/pkgs/nvim/config/utils/nvim-surround.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + nvim-surround + ]; + + extraConfigLua = '' + require("nvim-surround").setup() + ''; +} diff --git a/pkgs/nvim/config/utils/oil.nix b/pkgs/nvim/config/utils/oil.nix new file mode 100644 index 0000000..30a093c --- /dev/null +++ b/pkgs/nvim/config/utils/oil.nix @@ -0,0 +1,54 @@ +{ + plugins.oil = { + enable = true; + settings = { + useDefaultKeymaps = true; + deleteToTrash = true; + viewOptions = { + showHidden = true; + }; + preview = { + border = "rounded"; + }; + + float = { + padding = 2; + maxWidth = 0; # ''math.ceil(vim.o.lines * 0.8 - 4)''; + maxHeight = 0; # ''math.ceil(vim.o.columns * 0.8)''; + border = "rounded"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open + winOptions = { + winblend = 0; + }; + }; + keymaps = { + "g?" = "actions.show_help"; + "" = "actions.select"; + "" = "actions.select_vsplit"; + "" = "actions.select_split"; # this is used to navigate left + "" = "actions.select_tab"; + "" = "actions.preview"; + "" = "actions.close"; + "" = "actions.refresh"; + "-" = "actions.parent"; + "_" = "actions.open_cwd"; + "`" = "actions.cd"; + "~" = "actions.tcd"; + "gs" = "actions.change_sort"; + "gx" = "actions.open_external"; + "g." = "actions.toggle_hidden"; + "q" = "actions.close"; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "o"; + action = ":Oil --float"; + options = { + desc = "Open parent directory"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/persistence.nix b/pkgs/nvim/config/utils/persistence.nix new file mode 100644 index 0000000..eb7cde3 --- /dev/null +++ b/pkgs/nvim/config/utils/persistence.nix @@ -0,0 +1,5 @@ +{ + plugins.persistence = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/plenary.nix b/pkgs/nvim/config/utils/plenary.nix new file mode 100644 index 0000000..133b26f --- /dev/null +++ b/pkgs/nvim/config/utils/plenary.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + plenary-nvim + ]; +} diff --git a/pkgs/nvim/config/utils/project-nvim.nix b/pkgs/nvim/config/utils/project-nvim.nix new file mode 100644 index 0000000..b411ec7 --- /dev/null +++ b/pkgs/nvim/config/utils/project-nvim.nix @@ -0,0 +1,6 @@ +{ + plugins.project-nvim = { + enable = true; + enableTelescope = true; + }; +} diff --git a/pkgs/nvim/config/utils/sidebar.nix b/pkgs/nvim/config/utils/sidebar.nix new file mode 100644 index 0000000..0cc4316 --- /dev/null +++ b/pkgs/nvim/config/utils/sidebar.nix @@ -0,0 +1,55 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "sidebar.nvim"; + version = "2024-02-07"; + src = pkgs.fetchFromGitHub { + owner = "sidebar-nvim"; + repo = "sidebar.nvim"; + rev = "5695712eef6288fff667343c4ae77c54911bdb1b"; + sha256 = "1p12189367x0x26cys9wxipzwr3i0bmz4lb0s79ki0a49d6zja2c"; + }; + }) + ]; + extraConfigLua = '' + local sidebar = require("sidebar-nvim") + sidebar.setup({ + disable_default_keybindings = 0, + bindings = nil, + open = false, + side = "left", + initial_width = 32, + hide_statusline = false, + update_interval = 1000, + sections = { "git", "containers" }, + section_separator = {"", "-----", ""}, + section_title_separator = {""}, + containers = { + attach_shell = "/bin/sh", show_all = true, interval = 5000, + }, + datetime = { format = "%a %b %d, %H:%M", clocks = { { name = "local" } } }, + todos = { ignored_paths = {} }, + ["git"] = { + icon = "", --  + }, + }) + cmd = { + "SidebarNvimToggle", + "SidebarNvimOpen", + "SidebarNvimFocus", + "SidebarNvimUpdate", + }, + ''; + + keymaps = [ + { + mode = "n"; + key = "e"; + action = ":SidebarNvimToggle"; + options = { + desc = "Toggle Explorer"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/tmux-navigator.nix b/pkgs/nvim/config/utils/tmux-navigator.nix new file mode 100644 index 0000000..efb21c3 --- /dev/null +++ b/pkgs/nvim/config/utils/tmux-navigator.nix @@ -0,0 +1,5 @@ +{ + plugins.tmux-navigator = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/todo-comments.nix b/pkgs/nvim/config/utils/todo-comments.nix new file mode 100644 index 0000000..96878bb --- /dev/null +++ b/pkgs/nvim/config/utils/todo-comments.nix @@ -0,0 +1,5 @@ +{ + plugins.todo-comments = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/toggleterm.nix b/pkgs/nvim/config/utils/toggleterm.nix new file mode 100644 index 0000000..4a048df --- /dev/null +++ b/pkgs/nvim/config/utils/toggleterm.nix @@ -0,0 +1,57 @@ +{ + plugins.toggleterm = { + enable = true; + settings = { + size = '' + function(term) + if term.direction == "horizontal" then + return 15 + elseif term.direction == "vertical" then + return vim.o.columns * 0.4 + end + end + ''; + open_mapping = "[[]]"; + hide_numbers = true; + shade_terminals = true; + start_in_insert = true; + terminal_mappings = true; + persist_mode = true; + insert_mappings = true; + close_on_exit = true; + shell = "zsh"; + direction = "horizontal"; # 'vertical' | 'horizontal' | 'window' | 'float' + auto_scroll = true; + float_opts = { + border = "single"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open + width = 80; + height = 20; + winblend = 0; + }; + winbar = { + enabled = true; + name_formatter = '' + function(term) + return term.name + end + ''; + }; + }; + }; + + # extraConfigLua = '' + # function _G.set_terminal_keymaps() + # local opts = { buffer = 0 } + # vim.keymap.set("t", "", [[]], opts) + # vim.keymap.set("t", "jk", [[]], opts) + # vim.keymap.set("t", "", [[wincmd h]], opts) + # vim.keymap.set("t", "", [[wincmd j]], opts) + # vim.keymap.set("t", "", [[wincmd k]], opts) + # vim.keymap.set("t", "", [[wincmd l]], opts) + # vim.keymap.set("t", "", [[]], opts) + # end + # + # -- if you only want these mappings for toggle term use term://*toggleterm#* instead + # -- vim.cmd("autocmd! TermOpen term://*toggleterm#* lua set_terminal_keymaps()") + # ''; +} diff --git a/pkgs/nvim/config/utils/ultimate-autopair.nix b/pkgs/nvim/config/utils/ultimate-autopair.nix new file mode 100644 index 0000000..5730e45 --- /dev/null +++ b/pkgs/nvim/config/utils/ultimate-autopair.nix @@ -0,0 +1,17 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "ultimate-autopair.nvim"; + version = "2024-02-05"; + src = pkgs.fetchFromGitHub { + owner = "altermo"; + repo = "ultimate-autopair.nvim"; + rev = "25c13e0ce167db0255456cac10158b27d2be30c0"; + sha256 = "0bsxfj6g8fii9nn92vl15hdhafx3fikgiz4srr7y10pxz01c5s4c"; + }; + }) + ]; + extraConfigLua = '' + require('ultimate-autopair').setup() + ''; +} diff --git a/pkgs/nvim/config/utils/undotree.nix b/pkgs/nvim/config/utils/undotree.nix new file mode 100644 index 0000000..6232412 --- /dev/null +++ b/pkgs/nvim/config/utils/undotree.nix @@ -0,0 +1,26 @@ +{ + config, + pkgs, + host, + user, + ... +}: { + plugins.undotree = { + enable = true; + settings = { + autoOpenDiff = true; + focusOnToggle = true; + }; + }; + keymaps = [ + { + mode = "n"; + key = "ut"; + action = "UndotreeToggle"; + options = { + silent = true; + desc = "Undotree"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/vim-be-good.nix b/pkgs/nvim/config/utils/vim-be-good.nix new file mode 100644 index 0000000..39292ae --- /dev/null +++ b/pkgs/nvim/config/utils/vim-be-good.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + vim-be-good + ]; +} diff --git a/pkgs/nvim/config/utils/wakatime.nix b/pkgs/nvim/config/utils/wakatime.nix new file mode 100644 index 0000000..a007b47 --- /dev/null +++ b/pkgs/nvim/config/utils/wakatime.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + vim-wakatime + ]; +} diff --git a/pkgs/nvim/config/utils/whichkey.nix b/pkgs/nvim/config/utils/whichkey.nix new file mode 100644 index 0000000..3b01821 --- /dev/null +++ b/pkgs/nvim/config/utils/whichkey.nix @@ -0,0 +1,19 @@ +{ + # TODO: Implement general mappings + plugins.which-key = { + enable = true; + ignoreMissing = false; + icons = { + breadcrumb = "»"; + group = "+"; + separator = ""; # ➜ + }; + # registrations = { + # "t" = " Terminal"; + # }; + window = { + border = "none"; + winblend = 0; + }; + }; +} diff --git a/pkgs/nvim/config/utils/wilder.nix b/pkgs/nvim/config/utils/wilder.nix new file mode 100644 index 0000000..a816ea0 --- /dev/null +++ b/pkgs/nvim/config/utils/wilder.nix @@ -0,0 +1,43 @@ +{ + plugins.wilder = { + enable = true; + modes = [":" "/" "?"]; + pipeline = [ + '' + wilder.branch( + wilder.python_file_finder_pipeline({ + file_command = function(ctx, arg) + if string.find(arg, '.') ~= nil then + return {'fd', '-tf', '-H'} + else + return {'fd', '-tf'} + end + end, + dir_command = {'fd', '-td'}, + filters = {'cpsm_filter'}, + }), + wilder.substitute_pipeline({ + pipeline = wilder.python_search_pipeline({ + skip_cmdtype_check = 1, + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }), + }), + wilder.cmdline_pipeline({ + language = 'python', + fuzzy = 1, + }), + { + wilder.check(function(ctx, x) return x == "" end), + wilder.history(), + }, + wilder.python_search_pipeline({ + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }) + ) '' + ]; + }; +} diff --git a/pkgs/nvim/default.nix b/pkgs/nvim/default.nix new file mode 100644 index 0000000..2efe8c6 --- /dev/null +++ b/pkgs/nvim/default.nix @@ -0,0 +1,13 @@ +{ + pkgs, + inputs, + ... +}: let + system = pkgs.system; + nixvim = inputs.nixvim.legacyPackages.${system}; + nixvimModule = { + inherit pkgs; + module = import ./config; + extraSpecialArgs = {}; + }; +in (nixvim.makeNixvimWithModule nixvimModule) From 6f61595b3546623ff4f05d12f1ae0643a6dd9223 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 17:25:49 -0400 Subject: [PATCH 21/33] fix(nixvim): use correct telescope keybinds --- pkgs/nvim/config/telescope/telescope.nix | 44 ++++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pkgs/nvim/config/telescope/telescope.nix b/pkgs/nvim/config/telescope/telescope.nix index 508521c..19303aa 100644 --- a/pkgs/nvim/config/telescope/telescope.nix +++ b/pkgs/nvim/config/telescope/telescope.nix @@ -34,7 +34,7 @@ }; keymaps = { "" = { - action = "find_files, {}"; + action = "find_files"; options.desc = "Find project files"; }; "/" = { @@ -42,87 +42,87 @@ options.desc = "Grep (root dir)"; }; ":" = { - action = "command_history, {}"; + action = "command_history"; options.desc = "Command History"; }; "b" = { - action = "buffers, {}"; + action = "buffers"; options.desc = "+buffer"; }; "ff" = { - action = "find_files, {}"; + action = "find_files"; options.desc = "Find project files"; }; "fr" = { - action = "oldfiles, {}"; + action = "oldfiles"; options.desc = "Recent"; }; "fb" = { - action = "buffers, {}"; + action = "buffers"; options.desc = "Buffers"; }; "" = { - action = "git_files, {}"; + action = "git_files"; options.desc = "Search git files"; }; "gc" = { - action = "git_commits, {}"; + action = "git_commits"; options.desc = "Commits"; }; "gs" = { - action = "git_status, {}"; + action = "git_status"; options.desc = "Status"; }; "sa" = { - action = "autocommands, {}"; + action = "autocommands"; options.desc = "Auto Commands"; }; "sb" = { - action = "current_buffer_fuzzy_find, {}"; + action = "current_buffer_fuzzy_find"; options.desc = "Buffer"; }; "sc" = { - action = "command_history, {}"; + action = "command_history"; options.desc = "Command History"; }; "sC" = { - action = "commands, {}"; + action = "commands"; options.desc = "Commands"; }; "sD" = { - action = "diagnostics, {}"; + action = "diagnostics"; options.desc = "Workspace diagnostics"; }; "sh" = { - action = "help_tags, {}"; + action = "help_tags"; options.desc = "Help pages"; }; "sH" = { - action = "highlights, {}"; + action = "highlights"; options.desc = "Search Highlight Groups"; }; "sk" = { - action = "keymaps, {}"; + action = "keymaps"; options.desc = "Keymaps"; }; "sM" = { - action = "man_pages, {}"; + action = "man_pages"; options.desc = "Man pages"; }; "sm" = { - action = "marks, {}"; + action = "marks"; options.desc = "Jump to Mark"; }; "so" = { - action = "vim_options, {}"; + action = "vim_options"; options.desc = "Options"; }; "sR" = { - action = "resume, {}"; + action = "resume"; options.desc = "Resume"; }; "uC" = { - action = "colorscheme, {}"; + action = "colorscheme"; options.desc = "Colorscheme preview"; }; }; From 82479daa4cb720b19b42e1567e31d96e0253f137 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 17:56:16 -0400 Subject: [PATCH 22/33] fix(alacritty): use new config format --- user/modules/applications/alacritty.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/user/modules/applications/alacritty.nix b/user/modules/applications/alacritty.nix index e24e878..1a7b6f8 100644 --- a/user/modules/applications/alacritty.nix +++ b/user/modules/applications/alacritty.nix @@ -4,6 +4,7 @@ settings = { window = { decorations = "Buttonless"; + option_as_alt = "OnlyLeft"; }; font = { size = 14; @@ -16,11 +17,11 @@ italic.style = "Extended Italic"; bold_italic.style = "Extended Bold Italic"; }; - key_bindings = [ + keyboard.bindings = [ { key = "Slash"; mods = "Control"; - chars = "\\x1f"; + chars = "\\u001F"; } ]; }; From e413da516bd53b94fd80729ef84fb85ab7ff314e Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 17:56:35 -0400 Subject: [PATCH 23/33] chore(dev): remove unused kubernetes packages --- user/modules/dev.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/user/modules/dev.nix b/user/modules/dev.nix index 950b235..e5abd0b 100644 --- a/user/modules/dev.nix +++ b/user/modules/dev.nix @@ -12,10 +12,6 @@ php # Python python3 - # Kubernetes - azure-cli - kubectl - kubernetes-helm # Nix nil alejandra From 1b8b451999f04113897d38a08f62ee8e6d04fe41 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 17:56:56 -0400 Subject: [PATCH 24/33] fix(mac): remove emacs module --- user/environments/mac/home.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/user/environments/mac/home.nix b/user/environments/mac/home.nix index c6b9f65..ce62093 100644 --- a/user/environments/mac/home.nix +++ b/user/environments/mac/home.nix @@ -6,7 +6,6 @@ ../../modules/zsh.nix ../../modules/zellij ../../modules/dev.nix - ../../modules/emacs.nix ../../modules/git.nix ../../modules/fonts.nix ../../modules/latex.nix From 3162e6453461388bcff6c200887d0b719ceef921 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 17:57:21 -0400 Subject: [PATCH 25/33] chore: remove unused emacs module --- user/modules/emacs.nix | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 user/modules/emacs.nix diff --git a/user/modules/emacs.nix b/user/modules/emacs.nix deleted file mode 100644 index 6424dac..0000000 --- a/user/modules/emacs.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: { - programs.emacs = { - enable = true; - package = pkgs.unstable.emacs; - extraPackages = epkgs: [epkgs.vterm]; - }; -} From 4d876ac1cfe201a00b2017a9582dd486a87be3ae Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 17:58:01 -0400 Subject: [PATCH 26/33] feat(yabai): add shortcut for alacritty --- modules/yabai.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/yabai.nix b/modules/yabai.nix index 41fa5b5..cc07b98 100644 --- a/modules/yabai.nix +++ b/modules/yabai.nix @@ -74,6 +74,9 @@ | xargs -I{} yabai -m query --windows --space {} \ | jq -sre "add | map(select(.minimized != 1)) | sort_by(.display, .frame.y, .frame.x, .id) | reverse | nth(index(map(select(.focused == 1))) - 1).id" \ | xargs -I{} yabai -m window --focus {} + + # applications + ctrl + alt - t: open -n -a 'Alacritty.app' ''; }; } From 5c50fa63796252fedbddd183663088c49211c7d3 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 20:21:01 -0400 Subject: [PATCH 27/33] fix(nvim-custom): add dependencies to lint config --- pkgs/nvim/config/languages/nvim-lint.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/nvim/config/languages/nvim-lint.nix b/pkgs/nvim/config/languages/nvim-lint.nix index db8f109..7876ddd 100644 --- a/pkgs/nvim/config/languages/nvim-lint.nix +++ b/pkgs/nvim/config/languages/nvim-lint.nix @@ -1,8 +1,8 @@ -{ +{pkgs, ...}: { plugins.lint = { enable = true; lintersByFt = { - nix = ["statix"]; + nix = ["satix"]; lua = ["selene"]; python = ["flake8"]; javascript = ["eslint_d"]; @@ -13,4 +13,8 @@ java = ["checkstyle"]; }; }; + + extraPackages = with pkgs; [ + statix + ]; } From b9955a947fe13c4193ce4c305a9ee90e47842dfb Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 20:22:40 -0400 Subject: [PATCH 28/33] fix(nvim-custom): change modules --- pkgs/nvim/config/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/nvim/config/default.nix b/pkgs/nvim/config/default.nix index ff983f7..1a3e5fe 100644 --- a/pkgs/nvim/config/default.nix +++ b/pkgs/nvim/config/default.nix @@ -19,8 +19,8 @@ ./filetrees/neo-tree.nix ./git/gitsigns.nix ./git/diffview.nix - # ./git/lazygit.nix - ./git/neogit.nix + ./git/lazygit.nix + # ./git/neogit.nix ./languages/nvim-jdtls.nix ./languages/nvim-lint.nix @@ -77,7 +77,7 @@ ./utils/ultimate-autopair.nix ./utils/undotree.nix ./utils/vim-be-good.nix - ./utils/wakatime.nix + # ./utils/wakatime.nix ./utils/whichkey.nix ./utils/wilder.nix ]; From e4d7402948ba597a9aded29fb811405bda66ae32 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 3 Jun 2024 20:23:09 -0400 Subject: [PATCH 29/33] fix(nvim-custom): update toggleterm config --- pkgs/nvim/config/utils/toggleterm.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/nvim/config/utils/toggleterm.nix b/pkgs/nvim/config/utils/toggleterm.nix index 4a048df..f9e23f8 100644 --- a/pkgs/nvim/config/utils/toggleterm.nix +++ b/pkgs/nvim/config/utils/toggleterm.nix @@ -6,12 +6,12 @@ function(term) if term.direction == "horizontal" then return 15 - elseif term.direction == "vertical" then + elseif term.direction == "vertical" then return vim.o.columns * 0.4 end end ''; - open_mapping = "[[]]"; + open_mapping = "[[]]"; hide_numbers = true; shade_terminals = true; start_in_insert = true; @@ -20,7 +20,7 @@ insert_mappings = true; close_on_exit = true; shell = "zsh"; - direction = "horizontal"; # 'vertical' | 'horizontal' | 'window' | 'float' + direction = "float"; # 'vertical' | 'horizontal' | 'window' | 'float' auto_scroll = true; float_opts = { border = "single"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open From 898f440a692392806966adffe8e4adf48aa0313b Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 6 Jun 2024 20:26:56 +0000 Subject: [PATCH 30/33] feat: add neptune as a wireguard client --- machines/oracle/configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/machines/oracle/configuration.nix b/machines/oracle/configuration.nix index 48ebe9f..b5b4188 100644 --- a/machines/oracle/configuration.nix +++ b/machines/oracle/configuration.nix @@ -38,6 +38,10 @@ publicKey = "iKJO9Q8LsdCdApapTX9CJmrtAKn1TYhg4YUiBUBPzmo="; allowedIPs = ["10.0.10.2/32"]; } + { + publicKey = "IM7i+2BFsa+XyA4V4jd8iM+jpW307rDEkPOGdSddfzI="; + allowedIPs = ["10.0.10.3/32"]; + } ]; }; }; From 52922f8efabaa30b0d6ab32b11ce26aab030cd89 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 6 Jun 2024 20:27:11 +0000 Subject: [PATCH 31/33] fix(forgejo): use correct caddyfile syntax --- modules/services/forgejo/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/services/forgejo/default.nix b/modules/services/forgejo/default.nix index 67241b0..9a0a4d8 100644 --- a/modules/services/forgejo/default.nix +++ b/modules/services/forgejo/default.nix @@ -90,8 +90,7 @@ in { (mkIf cfg.proxy { services.caddy.virtualHosts."${forgejoDomain}".extraConfig = '' handle_errors { - status 502 - respond "This server is currently unavailable." + respond "This server is currently unavailable." 502 } redir /user/login /user/oauth2/Keycloak?{query} From ff29e743d9727a701a62899e3d80728190bf17e0 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 6 Jun 2024 20:27:27 +0000 Subject: [PATCH 32/33] wip(homer): add gruvbox theme colors --- modules/services/homer/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/services/homer/default.nix b/modules/services/homer/default.nix index ff5527d..e3a454f 100644 --- a/modules/services/homer/default.nix +++ b/modules/services/homer/default.nix @@ -11,6 +11,22 @@ with lib; let title = "Dashboard"; header = false; footer = false; + colors = { + dark = { + highlight-primary = "#cc241d"; + highlight-secondary = "#8ec07c"; + highlight-hover = "#d79921"; + background = "rgb(40,36,34)"; + card-background = "#3c3836"; + text = "#eaeaea"; + text-header = "#ffffff"; + text-title = "#fafafa"; + text-subtitle = "#f5f5f5"; + card-shadow = "rgba(0, 0, 0, 0.4)"; + link = "#3273dc"; + link-hover = "#ffdd57"; + }; + }; connectivityCheck = true; columns = "auto"; services = config.lib.webapps.homerServices; From 26abc8c1f3e251110488378c1660087defbb1312 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Fri, 7 Jun 2024 05:20:16 +0000 Subject: [PATCH 33/33] fix(oracle): use correct home module --- flake.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 6906103..dc12d21 100644 --- a/flake.nix +++ b/flake.nix @@ -85,10 +85,12 @@ }; nixosConfigurations = let - homeModule = { + baseHomeModule = { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = {inherit inputs;}; + }; + homeModule = baseHomeModule // { home-manager.users.michael = import ./user/environments/nixos/home.nix; }; in { @@ -155,7 +157,10 @@ defaultModules ++ [ ./modules/nix.nix - homeModule + baseHomeModule + { + home-manager.users.michael = import ./user/environments/nixos-server/home.nix; + } agenix.nixosModules.default { environment.systemPackages = [ @@ -191,9 +196,8 @@ modules = [ self.overlaysModule home-manager.darwinModules.home-manager + baseHomeModule { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; home-manager.users.michael = import ./user/environments/mac/home.nix; }