Files
clan-core/pkgs/ui/shell.nix
Jörg Thalheim d033f523b8 openapi: put a static version into the repository
This avoids a lot of rebuilds and we can also track api changes better
2023-11-24 15:56:27 +01:00

32 lines
750 B
Nix

{ fmod
, pkg
, pkgs
}:
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 ${../../pkgs/clan-cli/clan_cli/webui/openapi.json} .
orval
'';
}