naitokosuke · dotfiles

vp defaults to "managed" mode, where it downloads its own Node into ~/.local/share/vite-plus and ignores the one pkgs/vite-plus.nix wraps it with. system_first makes vp prefer the Node on PATH, falling back to a managed runtime only when there is none. vp env on would flip it back imperatively, so it is pinned here (#413).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16# vp defaults to "managed" mode, where it downloads its own Node into
# ~/.local/share/vite-plus and ignores the one pkgs/vite-plus.nix wraps it
# with. system_first makes vp prefer the Node on PATH, falling back to a
# managed runtime only when there is none. `vp env on` would flip it back
# imperatively, so it is pinned here (#413).
{ pkgs, ... }:

let
  jsonFormat = pkgs.formats.json { };
in
{
  xdg.configFile."vite-plus/config.json".source = jsonFormat.generate "vite-plus-config.json" {
    shimMode = "system_first";
  };
}
16 lines·534 chars·NIX