From cade967fb0e603171044558067784f802a3613cb Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Sun, 14 Jun 2026 21:01:02 +0200 Subject: [PATCH] Home/Nixinator: Configure opencode lsps + formatters --- home/christoph/nixinator/default.nix | 55 ++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/home/christoph/nixinator/default.nix b/home/christoph/nixinator/default.nix index 55ed776a..05356ec1 100644 --- a/home/christoph/nixinator/default.nix +++ b/home/christoph/nixinator/default.nix @@ -3,6 +3,7 @@ pkgs, nixosConfig, config, + hostname, lib, mylib, username, @@ -52,8 +53,8 @@ opencode = { enable = true; enableMcpIntegration = true; - extraPackages = [ - # pkgs.opencode-claude-auth # Installed using npm + extraPackages = with pkgs; [ + # opencode-claude-auth # Installed using npm ]; # Writes opencode.json @@ -86,8 +87,54 @@ command = ["alejandra" "$FILE"]; extensions = [".nix"]; }; + perltidy = { + command = ["perltidy" "$FILE"]; + extensions = [".pl"]; + }; + }; + lsp = { + nixd = { + command = ["nixd"]; + extensions = [".nix"]; + initialization = { + preferences = { + nixd = { + nixpkgs = {expr = "import {}";}; + options = { + nixos = {expr = "(builtins.getFlake \"/home/${username}/NixFlake\").nixosConfigurations.${hostname}.options";}; + home-manager = {expr = "(builtins.getFlake \"/home/${username}/NixFlake\").nixosConfigurations.\"${hostname}\".options.home-manager.users.type.getSubOptions []";}; + }; + diagnostic = { + suppress = ["sema-escaping-with" "var-bind-to-this" "escaping-this-with"]; + }; + }; + }; + }; + }; + perlnavigator = { + command = ["perlnavigator"]; + extensions = [".pl"]; + initialization = { + preferences = {}; + }; + }; + # perlpls = { + # command = ["pls"]; + # extensions = [".pl"]; + # initialization = { + # preferences = { + # perl = { + # perlcritic = {enabled = false;}; + # syntax = {enabled = true;}; + # }; + # }; + # }; + # }; + r-language-server = { + command = ["R" "--no-echo" "-e" "languageserver::run()"]; + extensions = [".r" ".rmd" ".quarto"]; + }; }; - lsp = true; permission = { "*" = "ask"; "read" = "allow"; @@ -99,7 +146,7 @@ plugin = [ "opencode-claude-auth@latest" # https://github.com/griffinmartin/opencode-claude-auth "@tarquinen/opencode-dcp@latest" # better compacting - "@slkiser/opencode-quota" + # "@slkiser/opencode-quota" ]; share = "disabled"; shell = "fish";