1
0
forked from clan/clan-core
clan-core/pkgs/webview-ui/flake-module.nix
DavHau 802f047341 devShells: make all shells inherit from default shell
Currently, important tools from the default shell are lost as soon as select-shell is used to switch to another shell. select-shell itself, for example is missing, which makes it impossible to switch back to another shell.
2024-07-05 15:01:25 +07:00

41 lines
937 B
Nix

{ ... }:
{
perSystem =
{
pkgs,
config,
self',
...
}:
{
packages.webview-ui = pkgs.buildNpmPackage {
pname = "clan-webview-ui";
version = "0.0.1";
src = ./app;
npmDeps = pkgs.fetchNpmDeps {
src = ./app;
hash = "sha256-3LjcHh+jCuarh9XmS+mOv7xaGgAHxf3L7fWnxxmxUGQ=";
};
# The prepack script runs the build script, which we'd rather do in the build phase.
npmPackFlags = [ "--ignore-scripts" ];
preBuild = ''
mkdir -p api
cat ${config.packages.clan-ts-api} > api/index.ts
'';
};
devShells.webview-ui = pkgs.mkShell {
inputsFrom = [
config.packages.webview-ui
self'.devShells.default
];
shellHook = ''
mkdir -p ./app/api
cat ${config.packages.clan-ts-api} > ./app/api/index.ts
'';
};
};
}