added baseNvim, and use it as default

This commit is contained in:
lsoriano-mcm
2025-08-07 11:42:24 -05:00
parent 13cd454fb3
commit b04c92cec6
+16 -26
View File
@@ -31,12 +31,18 @@
nixvimLib = nixvim.lib.${system}; nixvimLib = nixvim.lib.${system};
nixvim' = nixvim.legacyPackages.${system}; nixvim' = nixvim.legacyPackages.${system};
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
# Moved pkgs definition up for clarity and scope
inherit system overlays; inherit system overlays;
config.allowUnfree = true; 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 = { fullNixvimModule = {
inherit pkgs; inherit pkgs;
module = {pkgs, ...}: { module = {pkgs, ...}: {
@@ -49,27 +55,15 @@
./config/javascript ./config/javascript
./config/iac ./config/iac
]; ];
extraPackages = with pkgs; [ extraPackages = deps;
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
];
}; };
extraSpecialArgs = specialArgs; # Keep specialArgs for self-reference 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 = { baseNixvimModule = {
inherit pkgs; inherit pkgs;
module = {pkgs, ...}: { module = {pkgs, ...}: {
imports = [./config]; imports = [./config];
extraPackages = with pkgs; [sops lazygit nerd-fonts.jetbrains-mono]; extraPackages = deps;
}; };
extraSpecialArgs = specialArgs; extraSpecialArgs = specialArgs;
}; };
@@ -143,10 +137,8 @@
extraSpecialArgs = {}; extraSpecialArgs = {};
}; };
# Define the actual Neovim instances fullNvim = nixvim'.makeNixvimWithModule fullNixvimModule;
# --- MODIFIED: defaultNvim now uses fullNixvimModule --- baseNvim = nixvim'.makeNixvimWithModule baseNixvimModule;
defaultNvim = nixvim'.makeNixvimWithModule fullNixvimModule;
# --- END MODIFIED ---
rustNvim = nixvim'.makeNixvimWithModule rustNixvimModule; rustNvim = nixvim'.makeNixvimWithModule rustNixvimModule;
csharpNvim = nixvim'.makeNixvimWithModule csharpNixvimModule; csharpNvim = nixvim'.makeNixvimWithModule csharpNixvimModule;
goNvim = nixvim'.makeNixvimWithModule goNixvimModule; goNvim = nixvim'.makeNixvimWithModule goNixvimModule;
@@ -155,18 +147,16 @@
iacNvim = nixvim'.makeNixvimWithModule iacNixvimModule; iacNvim = nixvim'.makeNixvimWithModule iacNixvimModule;
in { in {
checks = { checks = {
# It's good practice to check the full module if it's your primary config default = nixvimLib.check.mkTestDerivationFromNixvimModule baseNixvimModule;
default = nixvimLib.check.mkTestDerivationFromNixvimModule fullNixvimModule;
}; };
packages = { packages = {
# Lets you run `nix run .` to start nixvim with all configurations default = baseNvim;
default = defaultNvim; fullNvim = fullNvim;
# Existing language-specific packages remain
rust = rustNvim; rust = rustNvim;
csharp = csharpNvim; csharp = csharpNvim;
golang = goNvim; golang = goNvim;
python = pythonNvim; python = pythonNvim;
javascript = javascriptNixvimModule; # This should be javascriptNvim not javascriptNixvimModule javascript = javascriptNvim; # This should be javascriptNvim not javascriptNixvimModule
iac = iacNvim; iac = iacNvim;
}; };
}; };