diff --git a/flake.nix b/flake.nix index 4a890fe..09c704a 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }; }; diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..33bf590 --- /dev/null +++ b/test.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +asdfa + + + +a +a +a +a +a +a +aa +aaaa +