From 5cc889d066862ed881361a9cec3a593ffab53842 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 10 Dec 2024 21:34:32 +0100 Subject: treewide: remove old vim options they aren't used since the addition of nixvim --- usecases/desktop/development.nix | 238 +++++++++------------------------------ 1 file changed, 51 insertions(+), 187 deletions(-) (limited to 'usecases/desktop/development.nix') diff --git a/usecases/desktop/development.nix b/usecases/desktop/development.nix index 48c4550..4146352 100644 --- a/usecases/desktop/development.nix +++ b/usecases/desktop/development.nix @@ -1,70 +1,26 @@ -inputs: { - config, - lib, +inputs: +{ pkgs, ... -}: let - inherit - (pkgs.unstable) +}: +let + inherit (pkgs.unstable) clang clang-tools - elixir_ls - haskell-language-server - marksman - nixd - ltex-ls - lua-language-server - typos-lsp - typst-lsp - vimPlugins ; - - pylsp-env = pkgs.unstable.python3.withPackages (p: - with p; [ - python-lsp-server - python-lsp-server.passthru.optional-dependencies.rope - python-lsp-ruff - pylsp-rope - ]); - - luaFormat = inputs.self.lib.generators.lua {}; -in { +in +{ imports = [ (import ./development/adb.nix inputs) (import ./development/latex.nix inputs) (import ./development/nixvim-dev.nix inputs) ]; - options = with lib; - with luaFormat.lib; { - vim.lsp = mkOption { - description = '' - Configure Neovim to use these LSP servers; - ''; - type = with types; - attrsOf (submodule { - freeformType = luaFormat.type; - - options = { - capabilities = mkOption { - default = mkRaw "capabilities"; - }; - cmd = mkOption { - type = with types; listOf str; - }; - on_attach = mkOption { - default = mkRaw "on_attach"; - }; - }; - }); - default = {}; - }; - }; - - config = { - users.extraUsers.minijackson.packages = [ + users.extraUsers.minijackson.packages = + [ pkgs.git-branchless - ] ++ (with pkgs.unstable; [ + ] + ++ (with pkgs.unstable; [ bintools clang clang-tools @@ -121,138 +77,47 @@ in { python3 ]); - programs.zsh.interactiveShellInit = '' - (( $+commands[rustc] )) && fpath+="$(rustc --print sysroot)/share/zsh/site-functions" - source ${../../dotfiles/git-branchless.zsh} - ''; - - vim = { - extraPlugins = with vimPlugins; [ - actions-preview-nvim - vim-pandoc - clangd_extensions-nvim - lsp_signature-nvim - neodev-nvim - nvim-lspconfig - playground - vim-grammarous - - # DAP - # nvim-dap - # nvim-dap-ui - # nvim-dap-virtual-text - # telescope-dap-nvim - - rustaceanvim - ]; + programs.zsh.interactiveShellInit = '' + (( $+commands[rustc] )) && fpath+="$(rustc --print sysroot)/share/zsh/site-functions" + source ${../../dotfiles/git-branchless.zsh} + ''; - lsp = { - bashls.cmd = ["${pkgs.unstable.nodePackages.bash-language-server}/bin/bash-language-server" "start"]; - clangd = { - cmd = [ - "${clang-tools}/bin/clangd" - "--background-index" - "--clang-tidy" - "--fallback-style=WebKit" - "--header-insertion-decorators" - "--header-insertion=iwyu" - ]; - capabilities = luaFormat.lib.mkRaw ''vim.tbl_extend("force", capabilities, { offsetEncoding = "utf-8" })''; - }; - elixirls.cmd = ["${elixir_ls}/bin/elixir-ls"]; - hls.cmd = ["${haskell-language-server}/bin/haskell-language-server" "--lsp"]; - ltex = { - cmd = ["${ltex-ls}/bin/ltex-ls"]; - filetypes = [ - "bib" - "gitcommit" - "markdown" - "org" - "plaintex" - "rst" - "rnoweb" - "tex" - "typst" - "pandoc" - "quarto" - "rmd" - "context" - ]; - }; - lua_ls = { - cmd = ["${lua-language-server}/bin/lua-language-server"]; - settings.Lua = { - completion.callSnippet = "Replace"; - telemetry.enable = false; - }; - }; - marksman.cmd = ["${marksman}/bin/marksman"]; - nixd = { - cmd = [(lib.getExe nixd)]; - settings.nixd.formatting.command = ["alejandra"]; - }; - pylsp = { - cmd = ["${pylsp-env}/bin/pylsp"]; - settings.pylsp.plugins.ruff.enabled = true; - }; - taplo.cmd = ["${pkgs.unstable.taplo}/bin/taplo" "lsp" "stdio"]; - typos_lsp.cmd = [(lib.getExe typos-lsp)]; - typst_lsp.cmd = [(lib.getExe typst-lsp)]; - }; - - luaConfig = with lib; let - toLua = luaFormat.generate; - lspconfigFor = name: settings: "lspconfig['${name}'].setup ${toLua settings}"; - lspconfig = - concatStringsSep - "\n" - (mapAttrsToList lspconfigFor config.vim.lsp); - in '' - require('vim-dev') - local on_attach = require('myConfig.exports').on_attach - local capabilities = require('myConfig.exports').capabilities - local lspconfig = require('lspconfig') - ${lspconfig} - ''; - }; + programs.liboping.enable = true; - programs.liboping.enable = true; + documentation.dev.enable = true; - documentation.dev.enable = true; - - boot.kernel.sysctl = { - # For RR - "kernel.perf_event_paranoid" = 1; - }; + boot.kernel.sysctl = { + # For RR + "kernel.perf_event_paranoid" = 1; + }; - home-manager.users.minijackson = {config, ...}: { + home-manager.users.minijackson = + { config, ... }: + { home.shellAliases.git = "git-branchless wrap --"; - home.file.".clang-format".source = - (pkgs.formats.yaml {}).generate - "clang-format.yml" - { - BasedOnStyle = "Mozilla"; - ColumnLimit = 100; - TabWidth = 4; - IndentWidth = 4; - UseTab = "ForIndentation"; - - AlignAfterOpenBracket = "AlwaysBreak"; - AccessModifierOffset = -4; - AlwaysBreakAfterDefinitionReturnType = "None"; - AlwaysBreakAfterReturnType = "None"; - AlwaysBreakTemplateDeclarations = true; - BinPackArguments = false; - BinPackParameters = false; - BreakConstructorInitializers = "BeforeComma"; - Cpp11BracedListStyle = true; - DerivePointerAlignment = false; - NamespaceIndentation = "Inner"; - PenaltyBreakBeforeFirstCallParameter = 2; - PointerAlignment = "Left"; - Standard = "Latest"; - }; + home.file.".clang-format".source = (pkgs.formats.yaml { }).generate "clang-format.yml" { + BasedOnStyle = "Mozilla"; + ColumnLimit = 100; + TabWidth = 4; + IndentWidth = 4; + UseTab = "ForIndentation"; + + AlignAfterOpenBracket = "AlwaysBreak"; + AccessModifierOffset = -4; + AlwaysBreakAfterDefinitionReturnType = "None"; + AlwaysBreakAfterReturnType = "None"; + AlwaysBreakTemplateDeclarations = true; + BinPackArguments = false; + BinPackParameters = false; + BreakConstructorInitializers = "BeforeComma"; + Cpp11BracedListStyle = true; + DerivePointerAlignment = false; + NamespaceIndentation = "Inner"; + PenaltyBreakBeforeFirstCallParameter = 2; + PointerAlignment = "Left"; + Standard = "Latest"; + }; programs.direnv = { enable = true; @@ -277,10 +142,9 @@ in { }; }; - nixpkgs.overlays = [ - (self: super: { - inherit (self.unstable) nix-direnv direnv; - }) - ]; - }; + nixpkgs.overlays = [ + (self: super: { + inherit (self.unstable) nix-direnv direnv; + }) + ]; } -- cgit v1.2.3