2021-07-01 18:15:25 +01:00
|
|
|
|
{ ripgrep
|
|
|
|
|
, git
|
|
|
|
|
, fzf
|
|
|
|
|
, makeWrapper
|
|
|
|
|
, vim_configurable
|
|
|
|
|
, vimPlugins
|
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, formats
|
|
|
|
|
, runCommand
|
|
|
|
|
, spacevim_config ? import ./init.nix
|
|
|
|
|
}:
|
2021-02-14 03:32:11 +00:00
|
|
|
|
|
2020-07-17 19:22:47 +01:00
|
|
|
|
let
|
2021-07-01 18:15:25 +01:00
|
|
|
|
format = formats.toml { };
|
2020-07-17 19:22:47 +01:00
|
|
|
|
vim-customized = vim_configurable.customize {
|
|
|
|
|
name = "vim";
|
|
|
|
|
# Not clear at the moment how to import plugins such that
|
|
|
|
|
# SpaceVim finds them and does not auto download them to
|
|
|
|
|
# ~/.cache/vimfiles/repos
|
|
|
|
|
vimrcConfig.packages.myVimPackage = with vimPlugins; { start = [ ]; };
|
|
|
|
|
};
|
2021-02-20 09:16:45 +00:00
|
|
|
|
spacevimdir = runCommand "SpaceVim.d" { } ''
|
|
|
|
|
mkdir -p $out
|
|
|
|
|
cp ${format.generate "init.toml" spacevim_config} $out/init.toml
|
|
|
|
|
'';
|
2021-07-01 18:15:25 +01:00
|
|
|
|
in
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-07-17 19:22:47 +01:00
|
|
|
|
pname = "spacevim";
|
2021-07-01 18:15:25 +01:00
|
|
|
|
version = "1.7.0";
|
2020-07-17 19:22:47 +01:00
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "SpaceVim";
|
|
|
|
|
repo = "SpaceVim";
|
|
|
|
|
rev = "v${version}";
|
2021-07-01 18:15:25 +01:00
|
|
|
|
sha256 = "sha256-TmfPeaGkH1Wq2b5lB29PUYDVddJVN3mBuPAmu9EtiGY=";
|
2020-07-17 19:22:47 +01:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-01 18:15:25 +01:00
|
|
|
|
nativeBuildInputs = [ makeWrapper vim-customized ];
|
2020-07-17 19:22:47 +01:00
|
|
|
|
buildInputs = [ vim-customized ];
|
|
|
|
|
|
|
|
|
|
buildPhase = ''
|
2021-02-20 17:08:41 +00:00
|
|
|
|
runHook preBuild
|
2020-07-17 19:22:47 +01:00
|
|
|
|
# generate the helptags
|
|
|
|
|
vim -u NONE -c "helptags $(pwd)/doc" -c q
|
2021-02-20 17:08:41 +00:00
|
|
|
|
runHook postBuild
|
2020-07-17 19:22:47 +01:00
|
|
|
|
'';
|
|
|
|
|
|
2021-02-20 17:08:41 +00:00
|
|
|
|
patches = [
|
|
|
|
|
# Don't generate helptags at runtime into read-only $SPACEVIMDIR
|
|
|
|
|
./helptags.patch
|
|
|
|
|
];
|
2020-07-17 19:22:47 +01:00
|
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-02-20 17:08:41 +00:00
|
|
|
|
runHook preInstall
|
2020-07-17 19:22:47 +01:00
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
|
|
|
|
|
cp -r $(pwd) $out/SpaceVim
|
|
|
|
|
|
|
|
|
|
# trailing slash very important for SPACEVIMDIR
|
|
|
|
|
makeWrapper "${vim-customized}/bin/vim" "$out/bin/spacevim" \
|
|
|
|
|
--add-flags "-u $out/SpaceVim/vimrc" --set SPACEVIMDIR "${spacevimdir}/" \
|
gitAndTools: move everything to the top level
The comment at the top of git-and-tools/default.nix said:
/* All git-relates tools live here, in a separate attribute set so that users
* can get a fast overview over what's available.
but unfortunately that hasn't actually held up in practice.
Git-related packages have continued to be added to the top level, or
into gitAndTools, or sometimes both, basically at random, so having
gitAndTools is just confusing. In fact, until I looked as part of
working on getting rid of gitAndTools, one program (ydiff) was
packaged twice independently, once in gitAndTools and once at the top
level (I fixed this in 98c34901969).
So I think it's for the best if we move away from gitAndTools, and
just put all the packages it previously contained at the top level.
I've implemented this here by just making gitAndTools an alias for the
top level -- this saves having loads of lines in aliases.nix. This
means that people can keep referring to gitAndTools in their
configuration, but it won't be allowed to be used within Nixpkgs, and
it won't be presented to new users by e.g. nix search.
The only other change here that I'm aware of is that
appendToName "minimal" is not longer called on the default git
package, because doing that would have necessitated having a private
gitBase variable like before. I think it makes more sense not to do
that anyway, and reserve the "minimal" suffix only for gitMinimal.
2021-01-14 17:49:32 +00:00
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ fzf git ripgrep]}
|
2021-02-20 17:08:41 +00:00
|
|
|
|
runHook postInstall
|
2020-07-17 19:22:47 +01:00
|
|
|
|
'';
|
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
|
meta = with lib; {
|
2020-07-17 19:22:47 +01:00
|
|
|
|
description = "Modern Vim distribution";
|
|
|
|
|
longDescription = ''
|
|
|
|
|
SpaceVim is a distribution of the Vim editor that’s inspired by spacemacs.
|
|
|
|
|
'';
|
|
|
|
|
homepage = "https://spacevim.org/";
|
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
|
maintainers = [ maintainers.fzakaria ];
|
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
};
|
|
|
|
|
}
|