Skip to content

Commit

Permalink
refactor: cleanup flake.nix (#735)
Browse files Browse the repository at this point in the history
* feat: add .envrc

* refactor: remove unneeded entries from flake.nix

* refactor: use inputsFrom to avoid repeating packages

* feat: remove .envrc

---------

Co-authored-by: Liam Dyer <[email protected]>
  • Loading branch information
konradmalik and Saghen authored Dec 24, 2024
1 parent 2d9703d commit 85fc2e7
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
packages = let
src = ./.;
version = "0.8.2";
in rec {
in {
blink-fuzzy-lib = let
inherit (inputs.fenix.packages.${system}.minimal) toolchain;
rustPlatform = pkgs.makeRustPlatform {
Expand All @@ -38,35 +38,15 @@
cargoHash = "sha256-t84hokb2loZ6FPPt4eN8HzgNQJrQUdiG5//ZbmlasWY=";

nativeBuildInputs = with pkgs; [ git ];

passthru.updateScript = pkgs.nix-update-script;
};

blink-cmp = let
inherit (pkgs.stdenv) hostPlatform;
libExt = if hostPlatform.isDarwin then
"dylib"
else if hostPlatform.isWindows then
"dll"
else
"so";
in pkgs.vimUtils.buildVimPlugin {
blink-cmp = pkgs.vimUtils.buildVimPlugin {
pname = "blink-cmp";
inherit src version;
preInstall = ''
mkdir -p target/release
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt}
ln -s ${self'.packages.blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.* target/release/
'';

passthru.updateScript = pkgs.nix-update-script;

meta = {
description =
"Performant, batteries-included completion plugin for Neovim ";
homepage = "https://github.com/saghen/blink.cmp";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ redxtech ];
};
};

default = self'.packages.blink-cmp;
Expand All @@ -89,12 +69,13 @@
# define the default dev environment
devShells.default = pkgs.mkShell {
name = "blink";
inputsFrom = [
self'.packages.blink-fuzzy-lib
self'.packages.blink-cmp
self'.apps.build-plugin
];
packages = with pkgs; [
git
gcc
fenix.complete.toolchain
rust-analyzer-nightly
nix-update
];
};
};
Expand Down

0 comments on commit 85fc2e7

Please sign in to comment.