noogle/website/shell.nix

22 lines
611 B
Nix
Raw Normal View History

2023-11-29 23:37:07 +03:00
{ fmod, pkg, pkgs, hooks, ... }:
2023-11-23 14:31:33 +03:00
pkgs.mkShell {
2023-12-07 19:56:23 +03:00
packages = [ fmod.config.floco.settings.nodePackage ];
2023-11-23 14:31:33 +03:00
shellHook = ''
2023-12-07 19:56:23 +03:00
${hooks.prepare "src/models/data"}
2023-11-29 23:37:07 +03:00
2023-11-23 14:31:33 +03:00
ID=${pkg.built.tree}
currID=$(cat .floco/.node_modules_id 2> /dev/null)
mkdir -p .floco
if [[ "$ID" != "$currID" || ! -d "node_modules" ]];
then
${pkgs.rsync}/bin/rsync -a --checksum --chmod=ug+w --delete ${pkg.built.tree}/node_modules/ ./node_modules/
echo -n $ID > .floco/.node_modules_id
echo "floco ok: node_modules updated"
fi
export PATH="$PATH:$(realpath ./node_modules)/.bin"
'';
}