From cb007cc158a9861edacac452da76ca3f37c319fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Tue, 5 Dec 2023 12:21:05 +0100 Subject: [PATCH] feat: improve neovim --- packages.nix | 2 ++ programs/affinity-photo.nix | 32 +++++++++++++++++++++++++ programs/nixvim.nix | 48 +++++++++++++++++++++---------------- 3 files changed, 62 insertions(+), 20 deletions(-) create mode 100644 programs/affinity-photo.nix diff --git a/packages.nix b/packages.nix index 44a9f2b..d606cbc 100644 --- a/packages.nix +++ b/packages.nix @@ -36,6 +36,7 @@ with pkgs; [ # creative gimp-with-plugins inkscape-with-extensions + scribus audacity # friture TODO: broken blender @@ -57,6 +58,7 @@ with pkgs; [ # utils gh + git-filter-repo neofetch pinentry-gnome ranger diff --git a/programs/affinity-photo.nix b/programs/affinity-photo.nix new file mode 100644 index 0000000..ec12a85 --- /dev/null +++ b/programs/affinity-photo.nix @@ -0,0 +1,32 @@ +{ + stdenv, + fetchurl, + pkgs, + p7zip, + wineWowPackages, + winetricks, +}: +stdenv.mkDerivation rec { + name = "affinity-photo"; + version = "1.10.6"; + + src = ./affinity-photo-${version}.exe; + dontUnpack = true; + + buildInputs = [wineWowPackages.stable winetricks]; + + installPhase = '' + mkdir -p $out/share/$name + cd $out/share/$name + ${p7zip}/bin/7z x $src + + mkdir -p $out/bin + cd $out/bin + echo "#!${stdenv.shell}" >> $name + echo "export WINEARCH=win64" >> $name + echo "export WINEPREFIX=~/.config/$name" >> $name + echo "${winetricks}/bin/winetricks -q corefonts dotnet472" >> $name + echo "${wineWowPackages.stable}/bin/wine $out/share/$name/App.exe" >> $name + chmod +x $name + ''; +} diff --git a/programs/nixvim.nix b/programs/nixvim.nix index d3356ef..ced21e4 100644 --- a/programs/nixvim.nix +++ b/programs/nixvim.nix @@ -141,11 +141,6 @@ in { extraConfigLua = '' require("darkman").setup() require("cmp-npm").setup({}) - require("codewindow").setup({ - auto_enable = true, - window_border = "none", - minimap_width = 10, - }) local signs = { { name = "DiagnosticSignError", text = "" }, @@ -340,6 +335,7 @@ in { direction = "vertical"; size = 60; }; + luasnip.enable = true; telescope = { enable = true; @@ -369,7 +365,12 @@ in { shellcheck.enable = true; }; diagnostics = { - eslint_d.enable = true; + eslint_d = { + enable = true; + withArgs = '' + {only_local = "node_modules/.bin"} + ''; + }; shellcheck.enable = true; }; formatting = { @@ -385,6 +386,7 @@ in { stylua.enable = true; }; }; + sourcesItems = [{__raw = "require('null-ls').builtins.diagnostics.stylelint";}]; onAttach = /* lua @@ -450,17 +452,23 @@ in { lspkind = { enable = true; - mode = "symbol"; - cmp.after = '' - function(entry, vim_item, kind) - if entry.source.name == "npm" then - kind.kind = "" - kind.kind_hl_group = "CmpItemKindNpm" - end - kind.kind = kind.kind .. " " - return kind - end - ''; + mode = "symbol_text"; + cmp = { + after = + /* + lua + */ + '' + function(entry, vim_item, kind) + if entry.source.name == "npm" then + kind.kind = "" + kind.kind_hl_group = "CmpItemKindNpm" + end + kind.kind = kind.kind .. " " + return kind + end + ''; + }; symbolMap = { Copilot = ""; }; @@ -476,6 +484,7 @@ in { sources = [ {name = "copilot";} {name = "path";} + {name = "luasnip";} { name = "npm"; keywordLength = 4; @@ -485,7 +494,7 @@ in { {name = "nvim_lsp_signature_help";} {name = "nvim_lsp_document_symbol";} ]; - formatting.fields = ["kind" "abbr" "menu"]; + formatting.fields = ["abbr" "kind"]; window = { completion.border = "rounded"; documentation.border = "rounded"; @@ -500,11 +509,10 @@ in { nix.enable = true; }; - extraPackages = [angular-ls pkgs.nodePackages.typescript-language-server]; + extraPackages = [angular-ls pkgs.nodePackages.typescript-language-server pkgs.nodePackages.stylelint]; extraPlugins = with pkgs.vimPlugins; [ vim-startuptime vim-mergetool - codewindow-nvim darkman ]; }