From a5226f566e941406b00245575c14b4662a31a573 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Sat, 25 May 2024 14:26:39 +0200 Subject: [PATCH] firefox: add addons per nix --- nix/flake.lock | 221 ++++++++----- nix/flake.nix | 9 + nix/hardware/overheating/base_config.nix | 1 + nix/hardware/overheating/configuration.nix | 3 + nix/programs/coding.nix | 1 + nix/programs/common.nix | 5 +- nix/programs/default.nix | 2 + nix/programs/hyprland/config.nix | 3 +- nix/programs/individual_configs/default.nix | 2 + nix/programs/individual_configs/firefox.nix | 29 ++ nix/programs/individual_configs/keepass.nix | 26 ++ nix/programs/nvim/lua/config/options.lua | 1 + nix/programs/nvim/lua/plugins/lsp.lua | 349 +++++++++++--------- nix/programs/nvim/lua/plugins/plugins.lua | 11 + 14 files changed, 422 insertions(+), 241 deletions(-) create mode 100644 nix/programs/individual_configs/firefox.nix create mode 100644 nix/programs/individual_configs/keepass.nix diff --git a/nix/flake.lock b/nix/flake.lock index 348abc4..20a2d8b 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -84,7 +84,7 @@ "flake-parts_2": { "inputs": { "nixpkgs-lib": [ - "oxicalc", + "hyprdock", "nixpkgs" ] }, @@ -105,7 +105,7 @@ "flake-parts_3": { "inputs": { "nixpkgs-lib": [ - "oxidash", + "oxicalc", "nixpkgs" ] }, @@ -126,7 +126,7 @@ "flake-parts_4": { "inputs": { "nixpkgs-lib": [ - "oxinoti", + "oxidash", "nixpkgs" ] }, @@ -147,7 +147,7 @@ "flake-parts_5": { "inputs": { "nixpkgs-lib": [ - "oxipaste", + "oxinoti", "nixpkgs" ] }, @@ -168,7 +168,7 @@ "flake-parts_6": { "inputs": { "nixpkgs-lib": [ - "oxishut", + "oxipaste", "nixpkgs" ] }, @@ -187,6 +187,27 @@ } }, "flake-parts_7": { + "inputs": { + "nixpkgs-lib": [ + "oxishut", + "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-parts_8": { "inputs": { "nixpkgs-lib": [ "reset", @@ -335,11 +356,30 @@ "type": "github" } }, + "hyprdock": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1716453478, + "narHash": "sha256-EoKGnKvYKoe9geFoK0wyEAMTPGOfRtjXibt4GUCfvBA=", + "owner": "DashieTM", + "repo": "hyprdock", + "rev": "8d07dbdf446e6b21528cc994547cc8f173a70330", + "type": "github" + }, + "original": { + "owner": "DashieTM", + "repo": "hyprdock", + "type": "github" + } + }, "ironbar": { "inputs": { "crane": "crane", "naersk": "naersk", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "rust-overlay": "rust-overlay" }, "locked": { @@ -358,7 +398,7 @@ }, "naersk": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1713520724, @@ -422,6 +462,22 @@ } }, "nixpkgs_10": { + "locked": { + "lastModified": 1706487304, + "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { "locked": { "lastModified": 1716137900, "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", @@ -437,7 +493,7 @@ "type": "github" } }, - "nixpkgs_11": { + "nixpkgs_12": { "locked": { "lastModified": 1716190602, "narHash": "sha256-xYRimrR0duWvokWQEvB87bSsICeCvvX9DxpUOzCfsDE=", @@ -453,7 +509,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_13": { "locked": { "lastModified": 1716137900, "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", @@ -469,23 +525,23 @@ "type": "github" } }, - "nixpkgs_13": { - "locked": { - "lastModified": 1706487304, - "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_14": { + "locked": { + "lastModified": 1706487304, + "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_15": { "locked": { "lastModified": 1716137900, "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", @@ -501,7 +557,7 @@ "type": "github" } }, - "nixpkgs_15": { + "nixpkgs_16": { "locked": { "lastModified": 1706487304, "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", @@ -517,7 +573,7 @@ "type": "github" } }, - "nixpkgs_16": { + "nixpkgs_17": { "locked": { "lastModified": 1716062047, "narHash": "sha256-OhysviwHQz4p2HZL4g7XGMLoUbWMjkMr/ogaR3VUYNA=", @@ -534,6 +590,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1716330097, + "narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1714314149, "narHash": "sha256-yNAevSKF4krRWacmLUsLK7D7PlfuY3zF0lYnGYNi9vQ=", @@ -547,7 +619,7 @@ "type": "indirect" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1714253743, "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", @@ -563,7 +635,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1716293225, "narHash": "sha256-pU9ViBVE3XYb70xZx+jK6SEVphvt7xMTbm6yDIF4xPs=", @@ -579,22 +651,6 @@ "type": "github" } }, - "nixpkgs_5": { - "locked": { - "lastModified": 1716137900, - "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6c0b7a92c30122196a761b440ac0d46d3d9954f1", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_6": { "locked": { "lastModified": 1716137900, @@ -612,6 +668,22 @@ } }, "nixpkgs_7": { + "locked": { + "lastModified": 1716137900, + "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6c0b7a92c30122196a761b440ac0d46d3d9954f1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { "locked": { "lastModified": 1706487304, "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", @@ -627,7 +699,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1716137900, "narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=", @@ -643,26 +715,25 @@ "type": "github" } }, - "nixpkgs_9": { + "nur": { "locked": { - "lastModified": 1706487304, - "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", + "lastModified": 1716637573, + "narHash": "sha256-i7KOcVGJE3oRvjF4r45/GvbrKHaxtSc4K9DCJ+DR9DQ=", + "owner": "nix-community", + "repo": "nur", + "rev": "a619ed4c9346515d8a9665cd3d44909944a1fc8e", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "nix-community", + "repo": "nur", "type": "github" } }, "oxicalc": { "inputs": { - "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_5" + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1716225554, @@ -680,8 +751,8 @@ }, "oxidash": { "inputs": { - "flake-parts": "flake-parts_3", - "nixpkgs": "nixpkgs_6", + "flake-parts": "flake-parts_4", + "nixpkgs": "nixpkgs_7", "rust-overlay": "rust-overlay_2" }, "locked": { @@ -700,8 +771,8 @@ }, "oxinoti": { "inputs": { - "flake-parts": "flake-parts_4", - "nixpkgs": "nixpkgs_8", + "flake-parts": "flake-parts_5", + "nixpkgs": "nixpkgs_9", "rust-overlay": "rust-overlay_3" }, "locked": { @@ -720,8 +791,8 @@ }, "oxipaste": { "inputs": { - "flake-parts": "flake-parts_5", - "nixpkgs": "nixpkgs_10", + "flake-parts": "flake-parts_6", + "nixpkgs": "nixpkgs_11", "rust-overlay": "rust-overlay_4" }, "locked": { @@ -740,8 +811,8 @@ }, "oxishut": { "inputs": { - "flake-parts": "flake-parts_6", - "nixpkgs": "nixpkgs_12", + "flake-parts": "flake-parts_7", + "nixpkgs": "nixpkgs_13", "rust-overlay": "rust-overlay_5" }, "locked": { @@ -760,8 +831,8 @@ }, "reset": { "inputs": { - "flake-parts": "flake-parts_7", - "nixpkgs": "nixpkgs_14", + "flake-parts": "flake-parts_8", + "nixpkgs": "nixpkgs_15", "rust-overlay": "rust-overlay_6" }, "locked": { @@ -783,9 +854,11 @@ "Hyprspace": "Hyprspace", "anyrun": "anyrun", "home-manager": "home-manager", + "hyprdock": "hyprdock", "ironbar": "ironbar", "nix-flatpak": "nix-flatpak", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", + "nur": "nur", "oxicalc": "oxicalc", "oxidash": "oxidash", "oxinoti": "oxinoti", @@ -820,7 +893,7 @@ "rust-overlay_2": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1716171463, @@ -839,7 +912,7 @@ "rust-overlay_3": { "inputs": { "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_9" + "nixpkgs": "nixpkgs_10" }, "locked": { "lastModified": 1716171463, @@ -858,7 +931,7 @@ "rust-overlay_4": { "inputs": { "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_11" + "nixpkgs": "nixpkgs_12" }, "locked": { "lastModified": 1716171463, @@ -877,7 +950,7 @@ "rust-overlay_5": { "inputs": { "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_13" + "nixpkgs": "nixpkgs_14" }, "locked": { "lastModified": 1716171463, @@ -896,7 +969,7 @@ "rust-overlay_6": { "inputs": { "flake-utils": "flake-utils_6", - "nixpkgs": "nixpkgs_15" + "nixpkgs": "nixpkgs_16" }, "locked": { "lastModified": 1716171463, @@ -914,7 +987,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_16", + "nixpkgs": "nixpkgs_17", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { diff --git a/nix/flake.nix b/nix/flake.nix index ec07b17..e4a3bf8 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -22,6 +22,11 @@ inputs.hyprland.follows = "nixpkgs"; }; + nur.url = "github:nix-community/nur"; + # hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + # hyprland.url = "git+https://github.com/hyprwm/Hyprland?rev=2f1735bd93adb9e153758cd4171d8fd3ae610357"; + # hyprland.url = "github:hyprwm/Hyprland/xwayland-rewrite?submodules=1"; + ironbar = { url = "github:JakeStanger/ironbar"; }; @@ -32,6 +37,7 @@ oxinoti.url = "github:DashieTM/OxiNoti"; oxidash.url = "github:DashieTM/OxiDash"; oxipaste.url = "github:DashieTM/OxiPaste"; + hyprdock.url = "github:DashieTM/hyprdock"; reset.url = "github:Xetibo/ReSet"; }; @@ -39,6 +45,9 @@ let pkgs = import inputs.nixpkgs { system = "x86_64-linux"; + overlays = [ + inputs.nur.overlay + ]; config = { allowUnfree = true; }; diff --git a/nix/hardware/overheating/base_config.nix b/nix/hardware/overheating/base_config.nix index 8f511ab..15d5330 100644 --- a/nix/hardware/overheating/base_config.nix +++ b/nix/hardware/overheating/base_config.nix @@ -13,4 +13,5 @@ programs.ironbar.battery = [ { type = "upower"; class = "memory-usage"; } ]; + programs.hyprland.extra_autostart = [ "hyprdock --server" ]; } diff --git a/nix/hardware/overheating/configuration.nix b/nix/hardware/overheating/configuration.nix index 576010f..becdaa5 100644 --- a/nix/hardware/overheating/configuration.nix +++ b/nix/hardware/overheating/configuration.nix @@ -13,4 +13,7 @@ programs.boot.boot_params = [ "rtc_cmos.use_acpi_alarm=1" ]; hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; + + # for hyprdock + services.acpid.enable = true; } diff --git a/nix/programs/coding.nix b/nix/programs/coding.nix index be3e5d6..fbaad83 100644 --- a/nix/programs/coding.nix +++ b/nix/programs/coding.nix @@ -21,6 +21,7 @@ # cpp bear + clang-tools #sql nodePackages.sql-formatter diff --git a/nix/programs/common.nix b/nix/programs/common.nix index a90f7ad..f07f500 100644 --- a/nix/programs/common.nix +++ b/nix/programs/common.nix @@ -15,7 +15,6 @@ in home.packages = with pkgs; [ vesktop kitty - firefox fish ripgrep rm-improved @@ -49,6 +48,7 @@ in greetd.regreet sops flake-checker + ffmpeg (callPackage ../override/streamdeck.nix { }) @@ -63,8 +63,11 @@ in programs.oxidash.enable = true; programs.oxishut.enable = true; programs.oxipaste.enable = true; + programs.hyprdock.enable = true; programs.reset.enable = true; + nixpkgs.config.allowUnfree = true; + home.username = "dashie"; home.homeDirectory = "/home/dashie"; home.stateVersion = "24.05"; diff --git a/nix/programs/default.nix b/nix/programs/default.nix index fb482c7..e0f5ed0 100644 --- a/nix/programs/default.nix +++ b/nix/programs/default.nix @@ -8,6 +8,8 @@ let inputs.oxinoti.homeManagerModules.default inputs.oxidash.homeManagerModules.default inputs.oxipaste.homeManagerModules.default + inputs.hyprdock.homeManagerModules.default + # inputs.hyprland.homeManagerModules.default inputs.reset.homeManagerModules.default inputs.nix-flatpak.homeManagerModules.nix-flatpak inputs.sops-nix.homeManagerModules.sops diff --git a/nix/programs/hyprland/config.nix b/nix/programs/hyprland/config.nix index f74649f..81acdb2 100644 --- a/nix/programs/hyprland/config.nix +++ b/nix/programs/hyprland/config.nix @@ -30,6 +30,7 @@ "$mod SUPER,G,exec,oxicalc" "$mod SUPER,D,exec,oxishut" "$mod SUPER,A,exec,oxipaste" + "$mod SUPERSHIFT,P,exec,hyprdock --gui" "$mod SUPERSHIFT,L,exec, playerctl -a pause & hyprlock & systemctl suspend" "$mod SUPERSHIFT,K,exec, playerctl -a pause & hyprlock & systemctl hibernate" @@ -242,8 +243,6 @@ "ironbar" "firefox" "oxipaste_daemon" - # TODO: is this necessary? - #"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" "nextcloud --background" "oxinoti" ] ++ config.programs.hyprland.extra_autostart; diff --git a/nix/programs/individual_configs/default.nix b/nix/programs/individual_configs/default.nix index a3ac262..3c2a87d 100644 --- a/nix/programs/individual_configs/default.nix +++ b/nix/programs/individual_configs/default.nix @@ -7,5 +7,7 @@ ./ssh.nix ./direnv.nix ./git.nix + ./firefox.nix + ./keepass.nix ]; } diff --git a/nix/programs/individual_configs/firefox.nix b/nix/programs/individual_configs/firefox.nix new file mode 100644 index 0000000..9016730 --- /dev/null +++ b/nix/programs/individual_configs/firefox.nix @@ -0,0 +1,29 @@ +{ inputs, pkgs, ... }: { + programs.firefox = { + enable = true; + + policies = { + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisplayBookmarksToolbar = "never"; + DisplayMenuBar = "default-off"; + }; + profiles.dashie = { + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + darkreader + privacy-badger + vimium + keepassxc-browser + i-dont-care-about-cookies + tokyo-night-v2 + + ]; + }; + }; +} diff --git a/nix/programs/individual_configs/keepass.nix b/nix/programs/individual_configs/keepass.nix new file mode 100644 index 0000000..58ffdb3 --- /dev/null +++ b/nix/programs/individual_configs/keepass.nix @@ -0,0 +1,26 @@ +{ + xdg.configFile."keepassxc/keepassxc.ini" = { + text = + '' + [General] + ConfigVersion=2 + + [Browser] + CustomProxyLocation= + Enabled=true + + [GUI] + ApplicationTheme=classic + HidePasswords=true + TrayIconAppearance=monochrome-light + + [PasswordGenerator] + AdditionalChars= + ExcludedChars= + Length=18 + + [Security] + EnableCopyOnDoubleClick=true + ''; + }; +} diff --git a/nix/programs/nvim/lua/config/options.lua b/nix/programs/nvim/lua/config/options.lua index e9c9543..7f5ec59 100644 --- a/nix/programs/nvim/lua/config/options.lua +++ b/nix/programs/nvim/lua/config/options.lua @@ -28,6 +28,7 @@ vim.g.mkdp_auto_start = 1 vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 vim.g.autoformat = false + for k, v in pairs(options) do vim.opt[k] = v end diff --git a/nix/programs/nvim/lua/plugins/lsp.lua b/nix/programs/nvim/lua/plugins/lsp.lua index 59ca30a..64c3f09 100644 --- a/nix/programs/nvim/lua/plugins/lsp.lua +++ b/nix/programs/nvim/lua/plugins/lsp.lua @@ -5,179 +5,200 @@ return { { "neovim/nvim-lspconfig", ---@class PluginLspOpts - opts = { - format_notify = false, - -- LSP Server Settings - ---@type lspconfig.options - servers = { - rust_analyzer = { - mason = false, - }, - marksman = { - mason = false, - }, - clangd = { - mason = false, - }, - jdtls = { - mason = false, - }, - gopls = { - mason = false, - }, - pyright = { - mason = false, - }, - ruff_lsp = { - mason = false, - }, - texlab = { - mason = false, - }, - 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 + opts = function(_, opts) + local path = vim.fn.stdpath("config") .. "/spell/ltex.dictionary.en-US.txt" + local words = {} + + local file, err = io.open(path, "r") + if err ~= nil then + os.execute("mkdir " .. vim.fn.stdpath("config") .. "/spell") + file = io.open(path, "w") + file:write("") + file:close() + file = io.open(path, "r") + end + for word in file:lines() do + table.insert(words, word) + end + local new_opts = { + format_notify = false, + -- LSP Server Settings + ---@type lspconfig.options + servers = { + rust_analyzer = { + mason = false, + }, + marksman = { + mason = false, + }, + clangd = { + mason = false, + }, + jdtls = { + mason = false, + }, + gopls = { + mason = false, + }, + pyright = { + mason = false, + }, + ruff_lsp = { + mason = false, + }, + texlab = { + mason = false, + }, + 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", + }, + }, + mason = false, + }, + bashls = { + mason = false, + }, + ansiblels = { + mason = false, + }, + omnisharp = { + mason = false, + handlers = { + ["textDocument/definition"] = function(...) + return require("omnisharp_extended").handler(...) end, - desc = "Show Crate Documentation", + }, + keys = { + { + "oe", + function() + require("omnisharp_extended").telescope_lsp_definitions() + end, + desc = "Goto Definition", + }, + }, + cmd = { + -- no comment + "OmniSharp", + "-z", + "--hostPID", + tostring(vim.fn.getpid()), + "DotNet:enablePackageRestore=false", + "--encoding", + "utf-8", + "--languageserver", + "FormattingOptions:EnableEditorConfigSupport=true", + "FormattingOptions:OrganizeImports=true", + "RoslynExtensionsOptions:EnableAnalyzersSupport=true", + "RoslynExtensionsOptions:EnableImportCompletion=true", + -- inlay hints are bugged until next release..... + -- "RoslynExtensionsOptions:InlayHintsOptions:EnableForParameters=true", + -- "RoslynExtensionsOptions:InlayHintsOptions:ForLiteralParameters=true", + -- "RoslynExtensionsOptions:InlayHintsOptions:ForIndexerParameters=true", + -- "RoslynExtensionsOptions:InlayHintsOptions:ForObjectCreationParameters=true", + -- "RoslynExtensionsOptions:InlayHintsOptions:ForOtherParameters=true", + -- "RoslynExtensionsOptions:InlayHintsOptions:SuppressForParametersThatDifferOnlyBySuffix=false", + -- "RoslynExtensionsOptions:InlayHintsOptions:SuppressForParametersThatMatchMethodIntent=false", + -- "RoslynExtensionsOptions:InlayHintsOptions:SuppressForParametersThatMatchArgumentName=false", + -- "RoslynExtensionsOptions:InlayHintsOptions:EnableForTypes=true", + -- "RoslynExtensionsOptions:InlayHintsOptions:ForImplicitVariableTypes=true", + -- "RoslynExtensionsOptions:InlayHintsOptions:ForLambdaParameterTypes=true", + -- "RoslynExtensionsOptions:InlayHintsOptions:ForImplicitObjectCreation=true", + "Sdk:IncludePrereleases=true", }, }, - mason = false, - }, - bashls = { - mason = false, - }, - ansiblels = { - mason = false, - }, - omnisharp = { - mason = false, - handlers = { - ["textDocument/definition"] = function(...) - return require("omnisharp_extended").handler(...) - end, + typst_lsp = { + settings = { + experimentalFormatterMode = "on", + exportPdf = "onSave", + }, + mason = false, }, - keys = { + nil_ls = { + settings = { + ["nil"] = { + formatting = { + command = { "nixpkgs-fmt" }, + }, + }, + }, + mason = false, + }, + ltex = { + settings = { + ltex = { + checkFrequency = "save", + dictionary = { + ["en-US"] = words, + }, + }, + }, + filetypes = { + "bib", + "gitcommit", + "markdown", + "org", + "plaintex", + "rst", + "rnoweb", + "tex", + "pandoc", + "typst", + "typ", + "text", + }, + mason = false, + }, + sqls = { + mason = false, + }, + lemminx = { + mason = false, + }, + opencl_ls = { + mason = false, + }, + yamlls = { + mason = false, + }, + zls = { + mason = false, + }, + jsonls = { + mason = false, + cmd = { "vscode-json-languageserver", "--stdio" }, + }, + cssls = { + mason = false, + cmd = { "css-languageserver", "--stdio" }, + }, + lua_ls = { + mason = false, { - "oe", - function() - require("omnisharp_extended").telescope_lsp_definitions() - end, - desc = "Goto Definition", - }, - }, - cmd = { - -- no comment - "OmniSharp", - "-z", - "--hostPID", - tostring(vim.fn.getpid()), - "DotNet:enablePackageRestore=false", - "--encoding", - "utf-8", - "--languageserver", - "FormattingOptions:EnableEditorConfigSupport=true", - "FormattingOptions:OrganizeImports=true", - "RoslynExtensionsOptions:EnableAnalyzersSupport=true", - "RoslynExtensionsOptions:EnableImportCompletion=true", - -- inlay hints are bugged until next release..... - -- "RoslynExtensionsOptions:InlayHintsOptions:EnableForParameters=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForLiteralParameters=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForIndexerParameters=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForObjectCreationParameters=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForOtherParameters=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:SuppressForParametersThatDifferOnlyBySuffix=false", - -- "RoslynExtensionsOptions:InlayHintsOptions:SuppressForParametersThatMatchMethodIntent=false", - -- "RoslynExtensionsOptions:InlayHintsOptions:SuppressForParametersThatMatchArgumentName=false", - -- "RoslynExtensionsOptions:InlayHintsOptions:EnableForTypes=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForImplicitVariableTypes=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForLambdaParameterTypes=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForImplicitObjectCreation=true", - "Sdk:IncludePrereleases=true", - }, - }, - typst_lsp = { - settings = { - experimentalFormatterMode = "on", - exportPdf = "onSave", - }, - mason = false, - }, - nil_ls = { - settings = { - ["nil"] = { - formatting = { - command = { "nixpkgs-fmt" }, - }, - }, - }, - mason = false, - }, - ltex = { - settings = { - ltex = { - checkFrequency = "save", - }, - }, - filetypes = { - "bib", - "gitcommit", - "markdown", - "org", - "plaintex", - "rst", - "rnoweb", - "tex", - "pandoc", - "typst", - "typ", - }, - mason = false, - }, - sqls = { - mason = false, - }, - lemminx = { - mason = false, - }, - opencl_ls = { - mason = false, - }, - yamlls = { - mason = false, - }, - zls = { - mason = false, - }, - jsonls = { - mason = false, - cmd = { "vscode-json-languageserver", "--stdio" }, - }, - cssls = { - mason = false, - cmd = { "css-languageserver", "--stdio" }, - }, - lua_ls = { - mason = false, - { - Lua = { - workspace = { - checkThirdParty = false, - }, - completion = { - callSnippet = "Replace", + Lua = { + workspace = { + checkThirdParty = false, + }, + completion = { + callSnippet = "Replace", + }, }, }, }, }, - }, - }, + } + return vim.tbl_deep_extend("keep", new_opts, opts) + end, init = function() local keys = require("lazyvim.plugins.lsp.keymaps").get() local my_keys = require("config.lsp-keymap").get() diff --git a/nix/programs/nvim/lua/plugins/plugins.lua b/nix/programs/nvim/lua/plugins/plugins.lua index de330e6..830c74f 100644 --- a/nix/programs/nvim/lua/plugins/plugins.lua +++ b/nix/programs/nvim/lua/plugins/plugins.lua @@ -281,4 +281,15 @@ return { }, { "akinsho/git-conflict.nvim", version = "*", config = true }, { "Hoffs/omnisharp-extended-lsp.nvim" }, + { + "barreiroleo/ltex_extra.nvim", + branch = "dev", + ft = { "markdown", "tex", "typst", "typ", "text" }, + config = function() + require("ltex_extra").setup({ + load_langs = { "en-US" }, + path = vim.fn.stdpath("config") .. "/spell", + }) + end, + }, }