From aa0bdc1e4b65e3fbbb10c49cd1d4e20d491359b3 Mon Sep 17 00:00:00 2001 From: Aargh Rai Date: Sun, 4 Jan 2026 11:25:48 +0530 Subject: rust lsp fix + languages on/off --- flake.nix | 29 ++++++++++++++++++++--------- nix.sh | 1 + nixos/languages/default.nix | 22 ++++++++++------------ nixos/opt/default.nix | 9 +++------ nvim/lua/configs/lspconfig.lua | 3 --- 5 files changed, 34 insertions(+), 30 deletions(-) diff --git a/flake.nix b/flake.nix index 59e4b8f..d905048 100644 --- a/flake.nix +++ b/flake.nix @@ -15,8 +15,8 @@ zen-browser = { url = "github:0xc000022070/zen-browser-flake"; inputs = { - # IMPORTANT: we're using "libgbm" and is only available in unstable so ensure - # to have it up-to-date or simply don't specify the nixpkgs input + # IMPORTANT: we're using "libgbm" and is only available in unstable so + # ensure to have it up-to-date or simply don't specify the nixpkgs input nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; }; @@ -34,16 +34,26 @@ system = "x86_64-linux"; username = "aargh"; hostname = "pegasus"; - nvidia = true; - llm = true; + opt = { + nvidia = true; + llm = true; + }; + languages = { + c = true; + asm = true; + lua = true; + python = true; + + go = false; + beam = false; + javascript = false; + rust = false; + zig = false; + }; # This is where I have keep the dotfiles folder, replace it accordingly symlinkRoot = "/home/${username}/dotfiles"; - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; unstable = import nixpkgs-unstable { inherit system; config.allowUnfree = true; @@ -52,7 +62,8 @@ nixosConfigurations.main = nixpkgs.lib.nixosSystem { inherit system; specialArgs = { - inherit quickshell inputs system username hostname unstable symlinkRoot nvidia llm; + inherit quickshell inputs system + username hostname unstable symlinkRoot opt languages; }; modules = [ diff --git a/nix.sh b/nix.sh index 40b0cd0..7dfa084 100755 --- a/nix.sh +++ b/nix.sh @@ -1 +1,2 @@ sudo nixos-rebuild switch --flake .#main + diff --git a/nixos/languages/default.nix b/nixos/languages/default.nix index 4f5cc75..b469aa4 100644 --- a/nixos/languages/default.nix +++ b/nixos/languages/default.nix @@ -1,15 +1,13 @@ -{ config, pkgs, ... }: +{ config, pkgs, languages, ... }: { imports = - [ - ./beam.nix - ./c.nix - ./asm.nix - ./go.nix - ./javascript.nix - ./lua.nix - ./python.nix - ./rust.nix - ./zig.nix - ]; + (if languages.beam then [ ./beam.nix ] else []) ++ + (if languages.c then [ ./c.nix ] else []) ++ + (if languages.asm then [ ./asm.nix ] else []) ++ + (if languages.go then [ ./go.nix ] else []) ++ + (if languages.javascript then [ ./javascript.nix ] else []) ++ + (if languages.lua then [ ./lua.nix ] else []) ++ + (if languages.python then [ ./python.nix ] else []) ++ + (if languages.rust then [ ./rust.nix ] else []) ++ + (if languages.zig then [ ./zig.nix ] else []); } diff --git a/nixos/opt/default.nix b/nixos/opt/default.nix index c9b6892..58a6dcf 100644 --- a/nixos/opt/default.nix +++ b/nixos/opt/default.nix @@ -1,9 +1,6 @@ -{ nvidia, llm, ... }: +{ opt, ... }: { imports = - (if nvidia then [ - ./nvidia.nix - ] else []) ++ (if llm then [ - ./llm.nix - ] else []); + (if opt.nvidia then [ ./nvidia.nix ] else []) ++ + (if opt.llm then [ ./llm.nix ] else []); } diff --git a/nvim/lua/configs/lspconfig.lua b/nvim/lua/configs/lspconfig.lua index cc741bd..14912dd 100644 --- a/nvim/lua/configs/lspconfig.lua +++ b/nvim/lua/configs/lspconfig.lua @@ -5,9 +5,6 @@ vim.lsp.enable(servers) local lspconfig = require("lspconfig") --- Rust -lspconfig.rust_analyzer.setup{} - -- Zig lspconfig.zls.setup{ cmd = { "zls" }, -- cgit v1.2.3