noogle/website/shell.nix

29 lines
912 B
Nix
Raw Normal View History

2023-12-22 22:34:22 +03:00
{ data-json, pasta-meta, 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-12-22 22:34:22 +03:00
cp -f ${data-json} src/models/data/data.json
cp -f ${pasta-meta} src/models/data/meta.json
cp -rf ${pkgs.inter}/share/fonts/opentype/* src/fonts
cp -rf ${pkgs.fira-code}/share/fonts/truetype/* src/fonts
chmod -R +w src/models/data
chmod -R +w src/fonts
2023-11-29 23:37:07 +03:00
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"
'';
}