Skip to content

Commit fc5feb8

Browse files
authored
fix: binary symlink in flake only working on Linux (#93)
1 parent 526f786 commit fc5feb8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

flake.nix

+7-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
# define the packages provided by this flake
3131
packages = let
3232
inherit (fenix.packages.${system}.minimal) toolchain;
33+
inherit (pkgs.stdenv) hostPlatform;
3334

3435
rustPlatform = pkgs.makeRustPlatform {
3536
cargo = toolchain;
@@ -52,13 +53,18 @@
5253
};
5354
};
5455
};
56+
57+
libExt =
58+
if hostPlatform.isDarwin then "dylib"
59+
else if hostPlatform.isWindows then "dll"
60+
else "so";
5561
in {
5662
blink-cmp = pkgs.vimUtils.buildVimPlugin {
5763
pname = "blink-cmp";
5864
inherit src version;
5965
preInstall = ''
6066
mkdir -p target/release
61-
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.so target/release/libblink_cmp_fuzzy.so
67+
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt}
6268
'';
6369

6470
meta = {

0 commit comments

Comments
 (0)