Skip to content

Commit

Permalink
docs: add nvim to dev shell as required for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcur committed Jul 16, 2024
1 parent ccdc5d1 commit d14a8d4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
47 changes: 26 additions & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,32 @@
cp "${name}.vim" $out
'';
};
devShells.default = pkgs.mkShell
{
buildInputs = (with pkgs; [
cargo
clippy
rust-analyzer
rustc
rustfmt
]) ++ [
# Automated screenshots
(pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped {
packpathDirs = {
myNeovimPackages.start = [
pkgs.vimPlugins.nvim-treesitter
pkgs.vimPlugins.nvim-treesitter-parsers.rust
];
};
})
termsnap.packages.${system}.default
];
};
devShells.default =
let
nvim = (pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped {
packpathDirs = {
myNeovimPackages.start = [
pkgs.vimPlugins.nvim-treesitter
pkgs.vimPlugins.nvim-treesitter-parsers.rust
];
};
});
in
pkgs.mkShell
{
buildInputs = (with pkgs; [
cargo
clippy
rust-analyzer
rustc
rustfmt
]) ++ [
# Automated screenshots
termsnap.packages.${system}.default
];

SCREENSHOT_NVIM = "${nvim}/bin/nvim";
};
}
);
}
7 changes: 6 additions & 1 deletion scripts/screenshots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ set -e

DIR=$(mktemp -d)

NVIM="nvim"
if [ -n "$SCREENSHOT_NVIM" ]; then
NVIM="$SCREENSHOT_NVIM"
fi

for light_dark in "light" "dark"; do
for colorscheme in "highlow" "twocolor" "grayscale"; do
cargo run -- ./colorschemes/$colorscheme.toml >"$DIR/$colorscheme.vim"

termsnap --term xterm-256color --columns 58 --lines 20 --render-before-clear -- \
nvim --clean \
"$NVIM" --clean \
-c "source ./scripts/nvim-config.vim" \
-c "set bg=$light_dark" \
-c "source $DIR/$colorscheme.vim" \
Expand Down

0 comments on commit d14a8d4

Please sign in to comment.