From b04c92cec69b7682158b5814de8eceb1920d2bb7 Mon Sep 17 00:00:00 2001 From: lsoriano-mcm Date: Thu, 7 Aug 2025 11:42:24 -0500 Subject: [PATCH] added baseNvim, and use it as default --- flake.nix | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/flake.nix b/flake.nix index af76c94..a89c954 100644 --- a/flake.nix +++ b/flake.nix @@ -31,12 +31,18 @@ nixvimLib = nixvim.lib.${system}; nixvim' = nixvim.legacyPackages.${system}; pkgs = import inputs.nixpkgs { - # Moved pkgs definition up for clarity and scope inherit system overlays; config.allowUnfree = true; }; + deps = with pkgs; [ + sops + lazygit + nerd-fonts.jetbrains-mono + rust-bin.stable.latest.default # From rust-overlay + ansible-lint + beautysh + ]; - # --- NEW: Define a comprehensive "fullNixvimModule" --- fullNixvimModule = { inherit pkgs; module = {pkgs, ...}: { @@ -49,27 +55,15 @@ ./config/javascript ./config/iac ]; - extraPackages = with pkgs; [ - sops - lazygit - nerd-fonts.jetbrains-mono - rust-bin.stable.latest.default # From rust-overlay - ansible-lint - beautysh - # Add any other packages needed across all configs here - ]; + extraPackages = deps; }; extraSpecialArgs = specialArgs; # Keep specialArgs for self-reference }; - # --- END NEW --- - - # You can keep these individual modules for specific language dev shells if you still want them - # They are not used by the default package anymore, but useful for testing/isolated environments baseNixvimModule = { inherit pkgs; module = {pkgs, ...}: { imports = [./config]; - extraPackages = with pkgs; [sops lazygit nerd-fonts.jetbrains-mono]; + extraPackages = deps; }; extraSpecialArgs = specialArgs; }; @@ -143,10 +137,8 @@ extraSpecialArgs = {}; }; - # Define the actual Neovim instances - # --- MODIFIED: defaultNvim now uses fullNixvimModule --- - defaultNvim = nixvim'.makeNixvimWithModule fullNixvimModule; - # --- END MODIFIED --- + fullNvim = nixvim'.makeNixvimWithModule fullNixvimModule; + baseNvim = nixvim'.makeNixvimWithModule baseNixvimModule; rustNvim = nixvim'.makeNixvimWithModule rustNixvimModule; csharpNvim = nixvim'.makeNixvimWithModule csharpNixvimModule; goNvim = nixvim'.makeNixvimWithModule goNixvimModule; @@ -155,18 +147,16 @@ iacNvim = nixvim'.makeNixvimWithModule iacNixvimModule; in { checks = { - # It's good practice to check the full module if it's your primary config - default = nixvimLib.check.mkTestDerivationFromNixvimModule fullNixvimModule; + default = nixvimLib.check.mkTestDerivationFromNixvimModule baseNixvimModule; }; packages = { - # Lets you run `nix run .` to start nixvim with all configurations - default = defaultNvim; - # Existing language-specific packages remain + default = baseNvim; + fullNvim = fullNvim; rust = rustNvim; csharp = csharpNvim; golang = goNvim; python = pythonNvim; - javascript = javascriptNixvimModule; # This should be javascriptNvim not javascriptNixvimModule + javascript = javascriptNvim; # This should be javascriptNvim not javascriptNixvimModule iac = iacNvim; }; };