Merge branch 'main' into avante

use pins for package call

syntax fix

add optional deps
This commit is contained in:
Alexandra Østermark 2025-05-15 19:23:58 +02:00
commit 5fe4106866
No known key found for this signature in database
GPG key ID: C2B9D34D979B6063
97 changed files with 1157 additions and 486 deletions

View file

@ -45,11 +45,18 @@ in
inherit version src;
dependencies = with vimPlugins; [
dressing-nvim
img-clip-nvim
nui-nvim
nvim-treesitter
dressing-nvim
plenary-nvim
nui-nvim
# optional, not sure how we best deal with adding these as options for the user to set
mini-pick
telescope-nvim
nvim-cmp
fzf-lua
nvim-web-devicons
img-clip-nvim
];
postInstall = let

38
flake/blink/default.nix Normal file
View file

@ -0,0 +1,38 @@
{
rustPlatform,
fetchFromGitHub,
writeShellScriptBin,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "blink-cmp";
version = "1.2.0";
src = fetchFromGitHub {
owner = "Saghen";
repo = "blink.cmp";
tag = "v${finalAttrs.version}";
hash = "sha256-bKe8SSg1HPWE7b4iRQJwiOVCrvvgttuHCOIa4U/38AY=";
};
forceShare = [
"man"
"info"
];
postInstall = ''
cp -r {lua,plugin} "$out"
mkdir -p "$out/doc"
cp 'doc/'*'.txt' "$out/doc/"
mkdir -p "$out/target"
mv "$out/lib" "$out/target/release"
'';
cargoHash = "sha256-IDoDugtNWQovfSstbVMkKHLBXKa06lxRWmywu4zyS3M=";
useFetchCargoVendor = true;
nativeBuildInputs = [
(writeShellScriptBin "git" "exit 1")
];
env.RUSTC_BOOTSTRAP = true;
})

View file

@ -3,13 +3,14 @@
pkgs,
config,
self',
inputs',
...
}: {
devShells = {
default = self'.devShells.lsp;
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
lsp = pkgs.mkShellNoCC {
packages = with pkgs; [nil statix deadnix alejandra npins];
packages = with pkgs; [inputs'.nil.packages.default statix deadnix alejandra npins];
};
};

View file

@ -1,46 +0,0 @@
{
inputs,
self,
...
}: {
perSystem = {
system,
inputs',
...
}: {
legacyPackages = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.self.overlays.default
(final: prev: {
# Build nil from source to get most recent
# features as they are added.
nil = inputs'.nil.packages.default;
blink-cmp = let
pin = self.pins.blink-cmp;
in
final.callPackage ./legacyPackages/blink-cmp.nix {
inherit (pin) version;
src = prev.fetchFromGitHub {
inherit (pin.repository) owner repo;
rev = pin.revision;
sha256 = pin.hash;
};
};
avante-nvim = let
pin = self.pins.avante-nvim;
in
final.callPackage ./legacyPackages/avante-nvim.nix {
version = pin.branch;
src = prev.fetchFromGitHub {
inherit (pin.repository) owner repo;
rev = pin.revision;
sha256 = pin.hash;
};
};
})
];
};
};
}

View file

@ -1,37 +0,0 @@
{
stdenv,
rustPlatform,
vimUtils,
gitMinimal,
src,
version,
}: let
blink-fuzzy-lib = rustPlatform.buildRustPackage {
pname = "blink-fuzzy-lib";
inherit version src;
# TODO: remove this if plugin stops using nightly rust
env.RUSTC_BOOTSTRAP = true;
useFetchCargoVendor = true;
cargoHash = "sha256-IDoDugtNWQovfSstbVMkKHLBXKa06lxRWmywu4zyS3M=";
nativeBuildInputs = [gitMinimal];
};
in
vimUtils.buildVimPlugin {
pname = "blink-cmp";
inherit version src;
# blink references a repro.lua which is placed outside the lua/ directory
doCheck = false;
preInstall = let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in ''
mkdir -p target/release
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy${ext} target/release/libblink_cmp_fuzzy${ext}
'';
# Module for reproducing issues
nvimSkipModules = ["repro"];
}

View file

@ -1,19 +0,0 @@
{
pkgs,
lib,
...
}: let
inherit (lib.nvim) neovimConfiguration;
buildPkg = pkgs: modules: (neovimConfiguration {inherit pkgs modules;}).neovim;
nixConfig = import ../configuration.nix false;
maximalConfig = import ../configuration.nix true;
in {
flake.overlays.default = final: _prev: {
inherit neovimConfiguration;
neovim-nix = buildPkg final [nixConfig];
neovim-maximal = buildPkg final [maximalConfig];
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
};
}

View file

@ -1,4 +1,8 @@
{inputs, ...}: {
{
inputs,
self,
...
} @ args: {
perSystem = {
config,
pkgs,
@ -6,8 +10,26 @@
...
}: let
docs = import ../docs {inherit pkgs inputs lib;};
buildPkg = maximal:
(args.config.flake.lib.nvim.neovimConfiguration {
inherit pkgs;
modules = [(import ../configuration.nix maximal)];
}).neovim;
in {
packages = {
blink-cmp = pkgs.callPackage ./blink {};
avante-nvim = let
pin = self.pins.avante-nvim;
in
pkgs.callPackage ./avante-nvim {
version = pin.branch;
src = pkgs.fetchFromGitHub {
inherit (pin.repository) owner repo;
rev = pin.revision;
sha256 = pin.hash;
};
};
inherit (docs.manual) htmlOpenTool;
# Documentation
docs = docs.manual.html;
@ -61,9 +83,9 @@
'';
# Exposed neovim configurations
nix = config.legacyPackages.neovim-nix;
maximal = config.legacyPackages.neovim-maximal;
default = config.legacyPackages.neovim-nix;
nix = buildPkg false;
maximal = buildPkg true;
default = config.packages.nix;
};
};
}

View file

@ -26,12 +26,22 @@
config.vim = {
theme.enable = true;
lsp = {
# Enable LSP functionality globally. This is required for modules found
# in `vim.languages` to enable relevant LSPs.
enable = true;
# You may define your own LSP configurations using `vim.lsp.servers` in
# nvf without ever needing lspconfig to do it. This will use the native
# API provided by Neovim > 0.11
servers = {};
};
# Language support and automatic configuration of companion plugins.
# Note that enabling, e.g., languages.<lang>.diagnostics will automatically
# enable top-level options such as enableLSP or enableExtraDiagnostics as
# they are needed.
languages = {
enableLSP = true;
enableFormat = true;
enableTreesitter = true;
enableExtraDiagnostics = true;