Files
nextjs-python-web-template/pkgs/ui/shell.nix
Luis ed18ad7d4d
All checks were successful
checks-impure / test (pull_request) Successful in 24s
checks / test (pull_request) Successful in 2m10s
Fix forgetting to delete api folder in UI
2023-11-03 22:44:44 +01:00

33 lines
749 B
Nix

{ fmod
, pkg
, pkgs
, clanPkgs
}:
pkgs.mkShell {
buildInputs = [
fmod.config.floco.settings.nodePackage
];
shellHook = ''
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
ln -sf ${pkgs.roboto}/share/fonts ./src
export PATH="$PATH:$(realpath ./node_modules)/.bin"
# re-generate the api code
rm -rf src/api openapi.json
cp ${clanPkgs.clan-openapi}/openapi.json .
orval
'';
}