mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
refactor: nuke legacyPackages and overlays
rework blink-cmp package
This commit is contained in:
parent
5f5aff2d46
commit
9feb71594d
14 changed files with 59 additions and 122 deletions
|
@ -12,6 +12,7 @@
|
||||||
inherit
|
inherit
|
||||||
(
|
(
|
||||||
(lib.evalModules {
|
(lib.evalModules {
|
||||||
|
specialArgs = {inherit inputs;};
|
||||||
modules =
|
modules =
|
||||||
import ../modules/modules.nix {
|
import ../modules/modules.nix {
|
||||||
inherit lib pkgs;
|
inherit lib pkgs;
|
||||||
|
|
|
@ -18,10 +18,7 @@
|
||||||
systems = import inputs.systems;
|
systems = import inputs.systems;
|
||||||
imports = [
|
imports = [
|
||||||
./flake/templates
|
./flake/templates
|
||||||
|
|
||||||
./flake/apps.nix
|
./flake/apps.nix
|
||||||
./flake/legacyPackages.nix
|
|
||||||
./flake/overlays.nix
|
|
||||||
./flake/packages.nix
|
./flake/packages.nix
|
||||||
./flake/develop.nix
|
./flake/develop.nix
|
||||||
];
|
];
|
||||||
|
|
31
flake/blink/default.nix
Normal file
31
flake/blink/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
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=";
|
||||||
|
};
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
cp -r {lua,plugin} "$out"
|
||||||
|
mkdir -p "$out/target"
|
||||||
|
mv "$out/lib" "$out/target/release"
|
||||||
|
'';
|
||||||
|
|
||||||
|
cargoHash = "sha256-IDoDugtNWQovfSstbVMkKHLBXKa06lxRWmywu4zyS3M=";
|
||||||
|
useFetchCargoVendor = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
(writeShellScriptBin "git" "exit 1")
|
||||||
|
];
|
||||||
|
|
||||||
|
env.RUSTC_BOOTSTRAP = true;
|
||||||
|
})
|
|
@ -3,13 +3,14 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
self',
|
self',
|
||||||
|
inputs',
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
devShells = {
|
devShells = {
|
||||||
default = self'.devShells.lsp;
|
default = self'.devShells.lsp;
|
||||||
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
||||||
lsp = pkgs.mkShellNoCC {
|
lsp = pkgs.mkShellNoCC {
|
||||||
packages = with pkgs; [nil statix deadnix alejandra npins];
|
packages = with pkgs; [inputs'.nil.packages.default statix deadnix alejandra npins];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,35 +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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -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"];
|
|
||||||
}
|
|
|
@ -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;}];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
{inputs, ...}: {
|
{inputs, ...} @ args: {
|
||||||
perSystem = {
|
perSystem = {
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
@ -6,8 +6,15 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
docs = import ../docs {inherit pkgs inputs lib;};
|
docs = import ../docs {inherit pkgs inputs lib;};
|
||||||
|
buildPkg = maximal:
|
||||||
|
(args.config.flake.lib.nvim.neovimConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [(import ../configuration.nix maximal)];
|
||||||
|
}).neovim;
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages = {
|
||||||
|
blink-cmp = pkgs.callPackage ./blink {};
|
||||||
|
|
||||||
inherit (docs.manual) htmlOpenTool;
|
inherit (docs.manual) htmlOpenTool;
|
||||||
# Documentation
|
# Documentation
|
||||||
docs = docs.manual.html;
|
docs = docs.manual.html;
|
||||||
|
@ -61,9 +68,9 @@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Exposed neovim configurations
|
# Exposed neovim configurations
|
||||||
nix = config.legacyPackages.neovim-nix;
|
nix = buildPkg false;
|
||||||
maximal = config.legacyPackages.neovim-maximal;
|
maximal = buildPkg true;
|
||||||
default = config.legacyPackages.neovim-nix;
|
default = config.packages.nix;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
types = import ./types {inherit lib;};
|
types = import ./types {inherit lib self;};
|
||||||
config = import ./config.nix {inherit lib;};
|
config = import ./config.nix {inherit lib;};
|
||||||
binds = import ./binds.nix {inherit lib;};
|
binds = import ./binds.nix {inherit lib;};
|
||||||
dag = import ./dag.nix {inherit lib;};
|
dag = import ./dag.nix {inherit lib;};
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
{lib}: let
|
{
|
||||||
|
lib,
|
||||||
|
self,
|
||||||
|
}: let
|
||||||
typesDag = import ./dag.nix {inherit lib;};
|
typesDag = import ./dag.nix {inherit lib;};
|
||||||
typesPlugin = import ./plugins.nix {inherit lib;};
|
typesPlugin = import ./plugins.nix {inherit lib self;};
|
||||||
typesLanguage = import ./languages.nix {inherit lib;};
|
typesLanguage = import ./languages.nix {inherit lib;};
|
||||||
customTypes = import ./custom.nix {inherit lib;};
|
customTypes = import ./custom.nix {inherit lib;};
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
{lib}: let
|
{
|
||||||
|
lib,
|
||||||
|
self,
|
||||||
|
}: let
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
||||||
inherit (lib.strings) hasPrefix removePrefix;
|
inherit (lib.strings) hasPrefix removePrefix;
|
||||||
|
@ -12,7 +15,7 @@
|
||||||
mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
|
mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
|
||||||
|
|
||||||
# Get the names of all npins
|
# Get the names of all npins
|
||||||
pluginInputNames = attrNames (lib.importJSON ../../npins/sources.json).pins;
|
pluginInputNames = ["blink-cmp"] ++ attrNames self.pins;
|
||||||
|
|
||||||
# You can either use the name of the plugin or a package.
|
# You can either use the name of the plugin or a package.
|
||||||
pluginType = nullOr (
|
pluginType = nullOr (
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
|
inputs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
else ''{"${package}/bin/${defaultCmd}"}'';
|
else ''{"${package}/bin/${defaultCmd}"}'';
|
||||||
servers = {
|
servers = {
|
||||||
nil = {
|
nil = {
|
||||||
package = pkgs.nil;
|
package = inputs.nil.packages.${pkgs.stdenv.system}.nil;
|
||||||
internalFormatter = true;
|
internalFormatter = true;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
lspconfig.nil_ls.setup{
|
lspconfig.nil_ls.setup{
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit (inputs.self.legacyPackages.${pkgs.stdenv.system}) blink-cmp;
|
inherit (inputs.self.packages.${pkgs.stdenv.system}) blink-cmp;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildConfigPlugins = plugins:
|
buildConfigPlugins = plugins:
|
||||||
|
|
|
@ -39,22 +39,6 @@
|
||||||
"url": "https://github.com/rrethy/base16-nvim/archive/965160025d0facbe9caa863e5beef2a7a488e9d1.tar.gz",
|
"url": "https://github.com/rrethy/base16-nvim/archive/965160025d0facbe9caa863e5beef2a7a488e9d1.tar.gz",
|
||||||
"hash": "02w1mn15gydma9canvqrlwf4l5z76s1vs01zanipwwflvwclsb8f"
|
"hash": "02w1mn15gydma9canvqrlwf4l5z76s1vs01zanipwwflvwclsb8f"
|
||||||
},
|
},
|
||||||
"blink-cmp": {
|
|
||||||
"type": "GitRelease",
|
|
||||||
"repository": {
|
|
||||||
"type": "GitHub",
|
|
||||||
"owner": "saghen",
|
|
||||||
"repo": "blink.cmp"
|
|
||||||
},
|
|
||||||
"pre_releases": false,
|
|
||||||
"version_upper_bound": null,
|
|
||||||
"release_prefix": null,
|
|
||||||
"submodules": false,
|
|
||||||
"version": "v1.2.0",
|
|
||||||
"revision": "d72a826e1961e14f91d8867d10a27a89c5cfe748",
|
|
||||||
"url": "https://api.github.com/repos/saghen/blink.cmp/tarball/v1.2.0",
|
|
||||||
"hash": "01phyx7y26p2123xpdp0zfp45rc8f014a8myxn2ga71m514vr9vc"
|
|
||||||
},
|
|
||||||
"blink-cmp-spell": {
|
"blink-cmp-spell": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue