FLAKE.NIX UPDATE

This commit is contained in:
lsoriano-mcm
2025-07-05 10:31:13 -05:00
parent f7d90f69fa
commit 16fa8eb258
2 changed files with 60 additions and 16 deletions
+45 -16
View File
@@ -30,6 +30,40 @@
overlays = [(import rust-overlay)];
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;
};
# --- NEW: Define a comprehensive "fullNixvimModule" ---
fullNixvimModule = {
inherit pkgs;
module = {pkgs, ...}: {
imports = [
./config
./config/rust
./config/csharp
./config/golang
./config/python
./config/javascript
./config/iac
];
extraPackages = with pkgs; [
sops
lazygit
nerd-fonts.jetbrains-mono
rust-bin.stable.latest.default # From rust-overlay
ansible-lint
# Add any other packages needed across all configs here
];
};
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, ...}: {
@@ -107,11 +141,11 @@
};
extraSpecialArgs = {};
};
pkgs = import inputs.nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
baseNvim = nixvim'.makeNixvimWithModule baseNixvimModule;
# Define the actual Neovim instances
# --- MODIFIED: defaultNvim now uses fullNixvimModule ---
defaultNvim = nixvim'.makeNixvimWithModule fullNixvimModule;
# --- END MODIFIED ---
rustNvim = nixvim'.makeNixvimWithModule rustNixvimModule;
csharpNvim = nixvim'.makeNixvimWithModule csharpNixvimModule;
goNvim = nixvim'.makeNixvimWithModule goNixvimModule;
@@ -120,23 +154,18 @@
iacNvim = nixvim'.makeNixvimWithModule iacNixvimModule;
in {
checks = {
# Run `nix flake check .` to verify that your config is not broken
default = nixvimLib.check.mkTestDerivationFromNixvimModule baseNixvimModule;
# It's good practice to check the full module if it's your primary config
default = nixvimLib.check.mkTestDerivationFromNixvimModule fullNixvimModule;
};
packages = {
# Lets you run `nix run .` to start nixvim
default = baseNvim;
# Lets you run `nix run .#rust` to start nixvim with Rust configuration
# Lets you run `nix run .` to start nixvim with all configurations
default = defaultNvim;
# Existing language-specific packages remain
rust = rustNvim;
# Lets you run `nix run .#csharp` to start nixvim with C# configuration
csharp = csharpNvim;
# Lets you run `nix run .#golang` to start nixvim with Go configuration
golang = goNvim;
# Lets you run `nix run .#python` to start nixvim with Python configuration
python = pythonNvim;
# Lets you run `nix run .#javascript` to start nixvim with JS/TS configuration
javascript = javascriptNvim;
# Lets you run `nix run .#javascript` to start nixvim with IaC configuration
javascript = javascriptNixvimModule; # This should be javascriptNvim not javascriptNixvimModule
iac = iacNvim;
};
};