diff --git a/flake.nix b/flake.nix index be355ed..3b0a52d 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; + }; } ); } diff --git a/scripts/screenshots.sh b/scripts/screenshots.sh index 7d95ac8..2038903 100755 --- a/scripts/screenshots.sh +++ b/scripts/screenshots.sh @@ -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" \