mirror of
https://github.com/dwinkler1/nvimConfig.git
synced 2026-02-19 14:30:58 -05:00
init wrapper-module config
This commit is contained in:
commit
91755583fd
46 changed files with 4277 additions and 0 deletions
98
overlays/README.md
Normal file
98
overlays/README.md
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
# Overlays
|
||||
|
||||
This directory contains composable Nix overlays used by the Neovim wrapper configuration. Each overlay is small and focused, so you can reuse or override them downstream.
|
||||
|
||||
## Files
|
||||
|
||||
- `r.nix`
|
||||
R-related overrides (rix overlay). Exposes `pkgs.rpkgs` from rstats-on-nix and creates pre-configured `rWrapper` and `quarto` with standard R packages.
|
||||
|
||||
- `python.nix`
|
||||
Python-related overrides and package additions (e.g., extra Python packages).
|
||||
|
||||
- `plugins.nix`
|
||||
Neovim plugin overrides (e.g., patching or pinning plugin derivations).
|
||||
|
||||
- `default.nix`
|
||||
Aggregates and exports the overlays in a composable way. Includes the fran overlay for custom R packages.
|
||||
|
||||
## Exports from `default.nix`
|
||||
|
||||
`overlays/default.nix` exposes:
|
||||
|
||||
- `rOverlay` - rix overlay for R packages from rstats-on-nix
|
||||
- `franOverlay` - fran overlay for custom R packages and tools
|
||||
- `pythonOverlay`
|
||||
- `pluginsOverlay`
|
||||
- `dependencyOverlays` (list of overlays in order)
|
||||
- `dependencyOverlay` (composed overlay via `lib.composeManyExtensions`)
|
||||
- `default` (alias of `dependencyOverlay`)
|
||||
- `dependencies` (alias of `dependencyOverlays`)
|
||||
|
||||
## Downstream usage examples
|
||||
|
||||
### Use the composed default overlay
|
||||
|
||||
```/dev/null/example.nix#L1-18
|
||||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
overlayDefs = import ./overlays/default.nix inputs;
|
||||
in {
|
||||
nixpkgs.overlays = [
|
||||
overlayDefs.default
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Use specific overlays only
|
||||
|
||||
```/dev/null/example.nix#L1-22
|
||||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
overlayDefs = import ./overlays/default.nix inputs;
|
||||
in {
|
||||
nixpkgs.overlays = [
|
||||
overlayDefs.rOverlay
|
||||
overlayDefs.pluginsOverlay
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Extend with your own overlay (composition)
|
||||
|
||||
```/dev/null/example.nix#L1-29
|
||||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
overlayDefs = import ./overlays/default.nix inputs;
|
||||
myOverlay = final: prev: {
|
||||
# Example: override a package
|
||||
myTool = prev.myTool.override { /* ... */ };
|
||||
};
|
||||
in {
|
||||
nixpkgs.overlays = [
|
||||
overlayDefs.default
|
||||
myOverlay
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
## Adding a new overlay
|
||||
|
||||
1. Create a new overlay file in this directory (e.g., `foo.nix`).
|
||||
2. Import it in `overlays/default.nix` and add it to `dependencyOverlays`.
|
||||
3. Optionally expose it as a named export (e.g., `fooOverlay`) for downstream reuse.
|
||||
|
||||
## Notes
|
||||
|
||||
- Keep overlays composable and focused.
|
||||
- Avoid monolithic overlays; prefer small, purpose-specific overlays.
|
||||
- When overriding plugins, keep patches minimal and document the intent.
|
||||
42
overlays/default.nix
Normal file
42
overlays/default.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ nixpkgs, ... }@inputs:
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
|
||||
rOverlay = import ./r.nix inputs;
|
||||
franOverlay = inputs.fran.overlays.default;
|
||||
pythonOverlay = import ./python.nix inputs;
|
||||
pluginsOverlay = import ./plugins.nix inputs;
|
||||
|
||||
dependencyOverlays = [
|
||||
rOverlay
|
||||
franOverlay
|
||||
pythonOverlay
|
||||
pluginsOverlay
|
||||
];
|
||||
dependencyOverlay = lib.composeManyExtensions dependencyOverlays;
|
||||
in
|
||||
{
|
||||
inherit
|
||||
rOverlay
|
||||
franOverlay
|
||||
pythonOverlay
|
||||
pluginsOverlay
|
||||
dependencyOverlays
|
||||
dependencyOverlay;
|
||||
|
||||
# Named exports for downstream composition.
|
||||
default = dependencyOverlay;
|
||||
dependencies = dependencyOverlays;
|
||||
|
||||
overlays = {
|
||||
inherit
|
||||
rOverlay
|
||||
franOverlay
|
||||
pythonOverlay
|
||||
pluginsOverlay
|
||||
dependencyOverlays
|
||||
dependencyOverlay;
|
||||
default = dependencyOverlay;
|
||||
dependencies = dependencyOverlays;
|
||||
};
|
||||
}
|
||||
25
overlays/plugins.nix
Normal file
25
overlays/plugins.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ ... }:
|
||||
final: prev:
|
||||
{
|
||||
codecompanion-nvim = prev.vimPlugins.codecompanion-nvim.overrideAttrs {
|
||||
checkInputs = with prev.vimPlugins; [
|
||||
blink-cmp
|
||||
mini-nvim
|
||||
];
|
||||
dependencies = [ prev.vimPlugins.plenary-nvim ];
|
||||
nvimSkipModules = [
|
||||
"codecompanion.actions.static"
|
||||
"codecompanion.actions.init"
|
||||
"minimal"
|
||||
"codecompanion.providers.actions.fzf_lua"
|
||||
"codecompanion.providers.completion.cmp.setup"
|
||||
"codecompanion.providers.actions.telescope"
|
||||
"codecompanion.providers.actions.snacks"
|
||||
];
|
||||
};
|
||||
zk-nvim = prev.vimPlugins.zk-nvim.overrideAttrs {
|
||||
nvimSkipModules = [
|
||||
"zk.pickers.fzf_lua"
|
||||
];
|
||||
};
|
||||
}
|
||||
12
overlays/python.nix
Normal file
12
overlays/python.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ ... }:
|
||||
final: prev:
|
||||
let
|
||||
reqPkgs = pyPackages:
|
||||
with pyPackages; [
|
||||
numpy
|
||||
];
|
||||
in
|
||||
{
|
||||
basePythonPackages = reqPkgs;
|
||||
python = prev.python3.withPackages reqPkgs;
|
||||
}
|
||||
46
overlays/r.nix
Normal file
46
overlays/r.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# R packages overlay (rix)
|
||||
#
|
||||
# This overlay provides access to R packages from rstats-on-nix.
|
||||
#
|
||||
# rstats-on-nix maintains snapshots of CRAN packages built with Nix:
|
||||
# - Provides reproducible R package versions
|
||||
# - Ensures binary cache availability for faster builds
|
||||
# - Maintained by the rstats-on-nix community
|
||||
#
|
||||
# Available attributes after applying this overlay:
|
||||
# - pkgs.rpkgs: R packages from rstats-on-nix
|
||||
# - pkgs.rpkgs.rPackages: All CRAN packages
|
||||
# - pkgs.rpkgs.quarto: Quarto publishing system
|
||||
# - pkgs.rpkgs.rWrapper: R with package management
|
||||
# - pkgs.rWrapper: R wrapper with standard packages pre-configured
|
||||
# - pkgs.quarto: Quarto with R integration and standard packages
|
||||
#
|
||||
# Custom R packages and tools (radianWrapper, air-formatter) come from
|
||||
# the fran overlay which should be applied separately.
|
||||
#
|
||||
# To use specific R packages, reference them via:
|
||||
# with pkgs.rpkgs.rPackages; [ package1 package2 ]
|
||||
#
|
||||
# Update the R snapshot date in flake.nix inputs section:
|
||||
# rixpkgs.url = "github:rstats-on-nix/nixpkgs/YYYY-MM-DD"
|
||||
{rixpkgs, ...}: final: prev: let
|
||||
# R packages from rstats-on-nix for the current system
|
||||
rpkgs = rixpkgs.legacyPackages.${prev.stdenv.hostPlatform.system};
|
||||
|
||||
# Standard R packages used by default in rWrapper and quarto
|
||||
reqPkgs = with rpkgs.rPackages; [
|
||||
languageserver
|
||||
];
|
||||
in {
|
||||
inherit rpkgs;
|
||||
baseRPackages = reqPkgs;
|
||||
|
||||
# R wrapper with standard packages
|
||||
rWrapper = rpkgs.rWrapper.override {packages = reqPkgs;};
|
||||
|
||||
# Quarto with R integration
|
||||
quarto = rpkgs.quarto.override {extraRPackages = reqPkgs;};
|
||||
|
||||
# Update helper for rix
|
||||
updateR = import ../scripts/updater.nix { pkgs = final; };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue