noogle/website/shell.nix

23 lines
592 B
Nix
Raw Normal View History

2023-12-22 23:09:02 +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-22 23:09:02 +03:00
${hooks.prepare}
2023-12-22 22:34:22 +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"
'';
}