forked from clan/clan-core
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.
41 lines
937 B
Nix
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
|
|
'';
|
|
};
|
|
};
|
|
}
|