samhh/dotfiles

nixd

Closed this issue · 2 comments

samhh commented

Looks better than rnix. Currently in unstable.

samhh commented
diff
diff --git a/flake.lock b/flake.lock
index 7c35e23..c6c87e1 100644
--- a/flake.lock
+++ b/flake.lock
@@ -190,6 +190,22 @@
         "type": "github"
       }
     },
+    "nixpkgs-unstable": {
+      "locked": {
+        "lastModified": 1689282004,
+        "narHash": "sha256-VNhuyb10c9SV+3hZOlxwJwzEGytZ31gN9w4nPCnNvdI=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "e74e68449c385db82de3170288a28cd0f608544f",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "ref": "nixos-unstable",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
     "root": {
       "inputs": {
         "agenix": "agenix",
@@ -198,6 +214,7 @@
         "home-manager": "home-manager_2",
         "nix-colors": "nix-colors",
         "nixpkgs": "nixpkgs",
+        "nixpkgs-unstable": "nixpkgs-unstable",
         "tshm-plugin": "tshm-plugin"
       }
     },
diff --git a/flake.nix b/flake.nix
index 8c325b4..be782e1 100644
--- a/flake.nix
+++ b/flake.nix
@@ -21,6 +21,7 @@
       nix-colors.url = "github:misterio77/nix-colors";
 
       nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
+      nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
 
       tshm-plugin = {
         url = "https://registry.yarnpkg.com/typescript-tshm-plugin/-/typescript-tshm-plugin-0.1.0.tgz";
@@ -28,7 +29,7 @@
       };
     };
 
-  outputs = { self, agenix, darwin, flake-utils, home-manager, nix-colors, nixpkgs, tshm-plugin }:
+  outputs = { self, agenix, darwin, flake-utils, home-manager, nix-colors, nixpkgs, nixpkgs-unstable, tshm-plugin }:
     let
       getLib = { lib, ... }: lib // import ./lib { inherit lib; };
     in
@@ -40,6 +41,8 @@
 
           fishPlugins = prev.fishPlugins // (final.callPackage ./pkgs/fishPlugins { });
           vimPlugins = prev.vimPlugins // (final.callPackage ./pkgs/vimPlugins { });
+
+          nixd = nixpkgs-unstable.legacyPackages.${system}.nixd;
         };
 
       getPkgs = system: import nixpkgs {
diff --git a/headful/cfg/nvim/plugin/lsp.lua b/headful/cfg/nvim/plugin/lsp.lua
index fe3f5fe..095d3d6 100644
--- a/headful/cfg/nvim/plugin/lsp.lua
+++ b/headful/cfg/nvim/plugin/lsp.lua
@@ -48,15 +48,15 @@ local function setup_servers()
     settings = { haskell = { formattingProvider = "stylish-haskell" } }
   }
 
-  lspc.purescriptls.setup {
+  lspc.nixd.setup {
     on_attach = attacher_fmt
   }
 
-  lspc.rust_analyzer.setup {
+  lspc.purescriptls.setup {
     on_attach = attacher_fmt
   }
 
-  lspc.rnix.setup {
+  lspc.rust_analyzer.setup {
     on_attach = attacher_fmt
   }
 
diff --git a/headful/editor.nix b/headful/editor.nix
index 105be15..d484456 100644
--- a/headful/editor.nix
+++ b/headful/editor.nix
@@ -87,8 +87,8 @@
       ## project's Nix dev shell.
       nodePackages.bash-language-server
       dhall-lsp-server
+      nixd
       nodePackages.purescript-language-server
-      rnix-lsp
       rust-analyzer
       # Needed for rust-analyzer.
       rustc
[lspconfig] Cannot access configuration for nixd. Ensure this server is listed in `server_configuratio
ns.md` or added as a custom server.

Guessing nvim-lspconfig in 23.05 is also outdated, so all of that would need to come from unstable as well.

samhh commented

nil is nice, and supported by Helix out of the box. 57a0a4f