12 , spacevim_config ? import ./init.nix
16 format = formats.toml { };
17 vim-customized = vim-full.customize {
19 # Not clear at the moment how to import plugins such that
20 # SpaceVim finds them and does not auto download them to
21 # ~/.cache/vimfiles/repos
22 vimrcConfig.packages.myVimPackage = with vimPlugins; { start = [ ]; };
24 spacevimdir = runCommand "SpaceVim.d" { } ''
26 cp ${format.generate "init.toml" spacevim_config} $out/init.toml
29 stdenv.mkDerivation rec {
32 src = fetchFromGitHub {
36 sha256 = "sha256:11snnh5q47nqhzjb9qya6hpnmlzc060958whqvqrh4hc7gnlnqp8";
39 nativeBuildInputs = [ makeWrapper vim-customized ];
40 buildInputs = [ vim-customized ];
44 # generate the helptags
45 vim -u NONE -c "helptags $(pwd)/doc" -c q
50 # Don't generate helptags at runtime into read-only $SPACEVIMDIR
58 cp -r $(pwd) $out/SpaceVim
60 # trailing slash very important for SPACEVIMDIR
61 makeWrapper "${vim-customized}/bin/vim" "$out/bin/spacevim" \
62 --add-flags "-u $out/SpaceVim/vimrc" --set SPACEVIMDIR "${spacevimdir}/" \
63 --prefix PATH : ${lib.makeBinPath [ fzf git ripgrep]}
68 description = "Modern Vim distribution";
70 SpaceVim is a distribution of the Vim editor that’s inspired by spacemacs.
72 homepage = "https://spacevim.org/";
73 license = licenses.gpl3Plus;
74 maintainers = [ maintainers.fzakaria ];
75 platforms = platforms.all;
76 mainProgram = "spacevim";