From 21b77e2ad2be46691ac0fc4fd73a6a2f84d2b426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 1 Oct 2023 21:15:49 +0200 Subject: [PATCH 1/5] feat(nvim): switch back to codeium This reverts commit b0f07137811d1df70e1963a1f0a4e6452271a626. --- flake.lock | 86 ++++++++++--------- flake.nix | 5 ++ modules/programs/nvim/plugins/coding.nix | 21 +---- .../programs/nvim/plugins/lua/nvim-cmp.lua | 6 +- overlays/vimPlugins.nix | 2 + 5 files changed, 60 insertions(+), 60 deletions(-) diff --git a/flake.lock b/flake.lock index 4d8dc1b..297db61 100644 --- a/flake.lock +++ b/flake.lock @@ -71,6 +71,29 @@ "type": "github" } }, + "codeium-nvim": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1695327957, + "narHash": "sha256-UsofTHPG8K7UqO0rJGHS2Ecbv+oVOYQ23Zk6SnshfOs=", + "owner": "jcdickinson", + "repo": "codeium.nvim", + "rev": "b65443d114d3c3c9dcc59ecd8a7dbb3a35320607", + "type": "github" + }, + "original": { + "owner": "jcdickinson", + "repo": "codeium.nvim", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -258,15 +281,12 @@ } }, "flake-utils": { - "inputs": { - "systems": "systems_2" - }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -277,7 +297,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_4" + "systems": "systems_3" }, "locked": { "lastModified": 1685518550, @@ -295,7 +315,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_5" + "systems": "systems_4" }, "locked": { "lastModified": 1685518550, @@ -469,7 +489,7 @@ "inputs": { "hyprland-protocols": "hyprland-protocols", "nixpkgs": "nixpkgs_4", - "systems": "systems_3", + "systems": "systems_2", "wlroots": "wlroots", "xdph": "xdph" }, @@ -1004,6 +1024,7 @@ "agenix": "agenix", "arkenfox-userjs": "arkenfox-userjs", "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", + "codeium-nvim": "codeium-nvim", "devshell": "devshell", "disko": "disko", "flake-parts": "flake-parts", @@ -1079,21 +1100,6 @@ } }, "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_3": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1108,6 +1114,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_4": { "locked": { "lastModified": 1681028828, @@ -1138,21 +1159,6 @@ "type": "github" } }, - "systems_6": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "telekasten-nvim": { "flake": false, "locked": { @@ -1207,7 +1213,7 @@ }, "utils": { "inputs": { - "systems": "systems_6" + "systems": "systems_5" }, "locked": { "lastModified": 1692799911, diff --git a/flake.nix b/flake.nix index ab2a1e1..e086c52 100644 --- a/flake.nix +++ b/flake.nix @@ -27,6 +27,11 @@ # Neovim actions-preview-nvim.flake = false; actions-preview-nvim.url = "github:aznhe21/actions-preview.nvim"; + codeium-nvim = { + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + url = "github:jcdickinson/codeium.nvim"; + }; hmts-nvim.flake = false; hmts-nvim.url = "github:calops/hmts.nvim"; neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index fc4d22a..9ebf581 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -86,26 +86,13 @@ with builtins; { plugin = cmp-cmdline; } { plugin = cmp-nvim-lsp; } { plugin = cmp_luasnip; } + { + plugin = codeium-nvim; + opts = { }; + } { plugin = friendly-snippets; } { plugin = lspkind-nvim; } { plugin = luasnip; } - { - plugin = copilot-cmp; - opts = { }; - dependencies = [ - { - plugin = copilot-lua; - opts = { - suggestion = { enabled = false; }; - panel = { enabled = false; }; - }; - conf = /* lua */ '' - require("copilot").setup(opts) - vim.cmd("Copilot disable") - ''; - } - ]; - } ]; } { diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index c48297b..975d84a 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -17,7 +17,7 @@ cmp.setup({ maxwidth = 50, -- prevent the popup from showing more than provided characters ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead symbol_map = { - Copilot = "", + Codeium = "", }, }), }, @@ -56,8 +56,8 @@ cmp.setup({ { name = "async_path", priority = 1 }, { name = "buffer", priority = 1 }, { name = "luasnip", priority = 2 }, - { name = "copilot", group_index = 3 }, - { name = "nvim_lsp", priority = 4 }, + { name = "codeium", priority = 3 }, + { name = "nvim_lsp", priority = 3 }, }, }) diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index 9794b9a..e1e564a 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -4,6 +4,8 @@ _: prev: with lib.my; { vimPlugins = prev.vimPlugins // { + inherit (inputs.codeium-nvim.packages.${prev.system}.vimPlugins) codeium-nvim; + smartcolumn-nvim = prev.vimUtils.buildVimPluginFrom2Nix { pname = "smartcolumn-nvim"; version = mkVersionInput inputs.smartcolumn-nvim; From d943ab8b6dfaca331c2f4f717eb305f1a5a0909b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 4 Oct 2023 15:02:27 +0200 Subject: [PATCH 2/5] feat(tmux): various improvements --- modules/profiles/base.nix | 4 ++++ modules/programs/tmux/default.nix | 4 ++-- modules/programs/tmux/tmux-attach/script.fish | 2 +- .../programs/tmux/tmux-sessionizer/script.fish | 9 ++++++++- overlays/packages.nix | 15 --------------- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index b0396ca..e5f4774 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -124,6 +124,10 @@ in "C-l" = "send-keys C-l"; "R" = "source-file $XDG_CONFIG_HOME/tmux/tmux.conf \\; display-message 'Reloaded tmux.conf'"; }; + root = { + "C-f" = "new-window ts"; + "C-a" = "new-window ta"; + }; copy-mode-vi = { "v" = "send -X begin-selection"; "V" = "send -X select-line"; diff --git a/modules/programs/tmux/default.nix b/modules/programs/tmux/default.nix index 6469f96..3f832e3 100644 --- a/modules/programs/tmux/default.nix +++ b/modules/programs/tmux/default.nix @@ -19,14 +19,14 @@ let tmux-sessionizer = pkgs.writeFishApplication { name = "ts"; - runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd fzf1 tmux-switch ]; + runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-switch ]; text = readFile ./tmux-sessionizer/script.fish; completions = readFile ./tmux-sessionizer/completions.fish; }; tmux-attach = pkgs.writeFishApplication { name = "ta"; - runtimeInputs = with pkgs; [ tmux fzf1 tmux-switch ]; + runtimeInputs = with pkgs; [ tmux tmux-switch ]; text = readFile ./tmux-attach/script.fish; completions = readFile ./tmux-attach/completions.fish; }; diff --git a/modules/programs/tmux/tmux-attach/script.fish b/modules/programs/tmux/tmux-attach/script.fish index 442dec2..1a4ddd6 100644 --- a/modules/programs/tmux/tmux-attach/script.fish +++ b/modules/programs/tmux/tmux-attach/script.fish @@ -1,4 +1,4 @@ -set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf1 $argv) +set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf $argv) if not test -n "$selected" exit 1 end diff --git a/modules/programs/tmux/tmux-sessionizer/script.fish b/modules/programs/tmux/tmux-sessionizer/script.fish index d0ca484..311ec4a 100644 --- a/modules/programs/tmux/tmux-sessionizer/script.fish +++ b/modules/programs/tmux/tmux-sessionizer/script.fish @@ -1,4 +1,11 @@ -set selected (fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | fzf1 $argv) +set pipe (mktemp --dry-run) +mkfifo $pipe + +fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | tee $pipe >/dev/null & +fd . ~/ --min-depth 1 --max-depth 3 --type d | tee $pipe >/dev/null & + +set selected (cat $pipe | fzf $argv) +rm -f "$pipe" set selected_name (basename $selected 2>/dev/null | string replace "." "_") diff --git a/overlays/packages.nix b/overlays/packages.nix index be4efad..b4f2473 100644 --- a/overlays/packages.nix +++ b/overlays/packages.nix @@ -11,19 +11,4 @@ final: prev: }); timers = inputs.timers.packages.${prev.system}.default; hyprland = inputs.hyprland.packages.${prev.system}.default; - - fzf1 = final.writeShellApplication { - name = "fzf1"; - runtimeInputs = with final; [ coreutils fzf fd ]; - text = '' - #!/usr/bin/env bash - selected=$(fzf --query="$*" -1 < /dev/stdin) - - if [[ -z $selected ]]; then - exit 0 - fi - - echo "$selected" - ''; - }; } From 28961fe11446ac25acaf605768f70d35034b4581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 8 Oct 2023 13:32:42 +0200 Subject: [PATCH 3/5] feat(nvim): update null-ls-nvim --- flake.lock | 17 +++++++++++++++++ flake.nix | 2 ++ modules/programs/nvim/default.nix | 6 ++++++ .../programs/nvim/plugins/lua/null-ls-nvim.lua | 6 ++++++ overlays/vimPlugins.nix | 5 +++++ 5 files changed, 36 insertions(+) diff --git a/flake.lock b/flake.lock index 297db61..926e2e1 100644 --- a/flake.lock +++ b/flake.lock @@ -930,6 +930,22 @@ "type": "github" } }, + "none-ls-nvim": { + "flake": false, + "locked": { + "lastModified": 1696658105, + "narHash": "sha256-4+B2F4ZweWTqXlhSs0jiBaKSv52G4X7p37KHfYl6sPo=", + "owner": "nvimtools", + "repo": "none-ls.nvim", + "rev": "ae339f45590cc421a68de885fc5a3261cc247362", + "type": "github" + }, + "original": { + "owner": "nvimtools", + "repo": "none-ls.nvim", + "type": "github" + } + }, "nvim-lspconfig": { "flake": false, "locked": { @@ -1040,6 +1056,7 @@ "nix-lazy-nvim": "nix-lazy-nvim", "nix-super": "nix-super", "nixpkgs": "nixpkgs_8", + "none-ls-nvim": "none-ls-nvim", "nvim-lspconfig": "nvim-lspconfig", "nvim-puppeteer": "nvim-puppeteer", "nvim-treesitter": "nvim-treesitter", diff --git a/flake.nix b/flake.nix index e086c52..282e8af 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,8 @@ telekasten-nvim.url = "github:renerocksai/telekasten.nvim"; telescope-nvim.flake = false; telescope-nvim.url = "github:nvim-telescope/telescope.nvim"; + none-ls-nvim.flake = false; + none-ls-nvim.url = "github:nvimtools/none-ls.nvim"; # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 96e7683..a7fdfcd 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -30,12 +30,17 @@ in [ alejandra black + checkmake deadnix + dotenv-linter + fish isort jq nixd nixpkgs-fmt nodePackages.bash-language-server + nodePackages.jsonlint + ruff-lsp rustfmt shellcheck shfmt @@ -46,6 +51,7 @@ in typst typst-lsp yamlfmt + yamllint ]; extraLuaConfig = readFile ./options.lua; lazy.enable = true; diff --git a/modules/programs/nvim/plugins/lua/null-ls-nvim.lua b/modules/programs/nvim/plugins/lua/null-ls-nvim.lua index 6701630..32a1f7e 100644 --- a/modules/programs/nvim/plugins/lua/null-ls-nvim.lua +++ b/modules/programs/nvim/plugins/lua/null-ls-nvim.lua @@ -8,9 +8,15 @@ null_ls.setup({ -- Completion null_ls.builtins.completion.spell, -- Diagnostics + null_ls.builtins.diagnostics.checkmake, null_ls.builtins.diagnostics.deadnix, + null_ls.builtins.diagnostics.dotenv_linter, + null_ls.builtins.diagnostics.fish, + null_ls.builtins.diagnostics.jsonlint, null_ls.builtins.diagnostics.shellcheck, null_ls.builtins.diagnostics.statix, + null_ls.builtins.diagnostics.trail_space, + null_ls.builtins.diagnostics.yamllint, }, }) diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index e1e564a..dda9ccb 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -51,5 +51,10 @@ with lib.my; version = mkVersionInput inputs.nvim-puppeteer; src = inputs.nvim-puppeteer; }; + + null-ls-nvim = prev.vimPlugins.null-ls-nvim.overrideAttrs (a: { + version = mkVersionInput inputs.none-ls-nvim; + src = inputs.none-ls-nvim; + }); }; } From 1eb008e41e6d9495ad620109a597c7aa62a0108b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 8 Oct 2023 13:33:57 +0200 Subject: [PATCH 4/5] feat(tmux): improve ta, ts and bindings --- modules/profiles/base.nix | 6 ++---- modules/programs/tmux/default.nix | 4 ++-- modules/programs/tmux/tmux-attach/script.fish | 2 +- modules/programs/tmux/tmux-sessionizer/script.fish | 8 ++++---- 4 files changed, 9 insertions(+), 11 deletions(-) mode change 100644 => 100755 modules/programs/tmux/tmux-sessionizer/script.fish diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index e5f4774..44158d7 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -123,10 +123,8 @@ in "|" = "split-window -h"; "C-l" = "send-keys C-l"; "R" = "source-file $XDG_CONFIG_HOME/tmux/tmux.conf \\; display-message 'Reloaded tmux.conf'"; - }; - root = { - "C-f" = "new-window ts"; - "C-a" = "new-window ta"; + "f" = "new-window ts"; + "a" = "new-window ta"; }; copy-mode-vi = { "v" = "send -X begin-selection"; diff --git a/modules/programs/tmux/default.nix b/modules/programs/tmux/default.nix index 3f832e3..67a4d5f 100644 --- a/modules/programs/tmux/default.nix +++ b/modules/programs/tmux/default.nix @@ -19,7 +19,7 @@ let tmux-sessionizer = pkgs.writeFishApplication { name = "ts"; - runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-switch ]; + runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-switch gawk ]; text = readFile ./tmux-sessionizer/script.fish; completions = readFile ./tmux-sessionizer/completions.fish; }; @@ -97,7 +97,7 @@ in if ! fish_is_root_user && test "$TERM_PROGRAM" != 'vscode' && ${insideVariableMissing} if test -z $tmux_autostarted set -x tmux_autostarted true - ts + tmux new -A -s home end end ''; diff --git a/modules/programs/tmux/tmux-attach/script.fish b/modules/programs/tmux/tmux-attach/script.fish index 1a4ddd6..6d1ab79 100644 --- a/modules/programs/tmux/tmux-attach/script.fish +++ b/modules/programs/tmux/tmux-attach/script.fish @@ -1,4 +1,4 @@ -set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf $argv) +set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf --query "$argv") if not test -n "$selected" exit 1 end diff --git a/modules/programs/tmux/tmux-sessionizer/script.fish b/modules/programs/tmux/tmux-sessionizer/script.fish old mode 100644 new mode 100755 index 311ec4a..a5e957b --- a/modules/programs/tmux/tmux-sessionizer/script.fish +++ b/modules/programs/tmux/tmux-sessionizer/script.fish @@ -1,10 +1,10 @@ +#!/usr/bin/env fish set pipe (mktemp --dry-run) mkfifo $pipe -fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | tee $pipe >/dev/null & -fd . ~/ --min-depth 1 --max-depth 3 --type d | tee $pipe >/dev/null & - -set selected (cat $pipe | fzf $argv) +fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec-batch dirname {} | tee $pipe >/dev/null & +fd . ~/ --min-depth 1 --max-depth 3 --type d --exec-batch realpath {} | tee $pipe >/dev/null & +set selected (cat $pipe | awk '!seen[$0]++' | fzf --query "$argv") rm -f "$pipe" set selected_name (basename $selected 2>/dev/null | string replace "." "_") From cb262d4cf54629b58fa15de6357824729a5c49d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 8 Oct 2023 13:34:13 +0200 Subject: [PATCH 5/5] feat(nvim)!: remove lsp-signature-help --- modules/programs/nvim/plugins/coding.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index 9ebf581..d0c0856 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -104,7 +104,6 @@ with builtins; event = [ "BufRead" "BufNewFile" ]; conf = readFile ./lua/nvim-lspconfig.lua; dependencies = [ - { plugin = lsp_signature-nvim; } { plugin = null-ls-nvim; conf = readFile ./lua/null-ls-nvim.lua;