build(nix): clean up nix flake (#21565)

This commit is contained in:
figsoda 2022-12-28 08:26:59 -05:00 committed by GitHub
parent 2732759bff
commit 3d0eca6b65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 19 deletions

6
.gitignore vendored
View File

@ -74,4 +74,10 @@ tags
# vim patches
/vim-*.patch
# nix build results
/result
/result-*
/contrib/result
/contrib/result-*
CMakeUserPresets.json

View File

@ -17,11 +17,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1669052418,
"narHash": "sha256-M1I4BKXBQm2gey1tScemEh5TpHHE3gKptL7BpWUvL8s=",
"lastModified": 1671983799,
"narHash": "sha256-Z2Ro6hFPZHkBqkVXY5/aBUzxi5xizQGvuHQ9+T5B/ks=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8",
"rev": "fad51abd42ca17a60fc1d4cb9382e2d79ae31836",
"type": "github"
},
"original": {

View File

@ -8,15 +8,11 @@
outputs = { self, nixpkgs, flake-utils }:
{
overlay = final: prev: rec {
overlay = final: prev: {
neovim = final.neovim-unwrapped.overrideAttrs (oa: {
version = "master";
src = ../.;
buildInputs = oa.buildInputs
++ final.lib.optionals final.stdenv.isDarwin
(with final.darwin.apple_sdk.frameworks; [ CoreServices ]);
});
# a development binary to help debug issues
@ -25,7 +21,7 @@
final.llvmPackages_latest.stdenv
else
final.stdenv;
in ((neovim.override {
in (final.neovim.override {
lua = final.luajit;
inherit stdenv;
}).overrideAttrs (oa: {
@ -37,13 +33,13 @@
cmakeFlags = oa.cmakeFlags ++ [ "-DMIN_LOG_LEVEL=0" ];
disallowedReferences = [ ];
}));
});
# for neovim developers, beware of the slow binary
neovim-developer = let luacheck = final.luaPackages.luacheck;
in (neovim-debug.override ({
neovim-developer = let inherit (final.luaPackages) luacheck;
in (final.neovim-debug.override {
doCheck = final.stdenv.isLinux;
})).overrideAttrs (oa: {
}).overrideAttrs (oa: {
cmakeFlags = oa.cmakeFlags ++ [
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
"-DMIN_LOG_LEVEL=0"
@ -113,15 +109,10 @@
# ASAN_OPTIONS=detect_leaks=1
export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1"
export UBSAN_OPTIONS=print_stacktrace=1
mkdir -p build/runtime/parser
# nvim looks into CMAKE_INSTALL_DIR. Hack to avoid errors
# when running the functionaltests
mkdir -p outputs/out/share/nvim/syntax
touch outputs/out/share/nvim/syntax/syntax.vim
# for treesitter functionaltests
mkdir -p runtime/parser
cp -f ${pkgs.tree-sitter.builtGrammars.tree-sitter-c}/parser runtime/parser/c.so
cp -f ${pkgs.vimPlugins.nvim-treesitter.builtGrammars.c}/parser runtime/parser/c.so
'';
});
};