| After setting up my aforementioned pnpm build, I am now wondering why the devshell and build derivations behave differently. My outputs look like this:
devShells.default = pkgs.mkShellNoCC {
inherit pnpmDeps cargoDeps;
inputsFrom = [ self.packages.${system}.default ];
};
packages.default = pkgs.stdenvNoCC.mkDerivation (finalAttrs: {
inherit pnpmDeps cargoDeps pname version;
src = gitignoreSource ./.;
strict = true;
doCheck = false;
nativeBuildInputs = with pkgs; [
wasm-bindgen-cli
nodejs
nodejs.pkgs.pnpm.configHook
pkgs.rustPlatform.cargoSetupHook
wrappedWasmPack
(rust-bin.stable.latest.default.override {targets = ["wasm32-unknown-unknown"];})
];
buildPhase = ''
pnpm build
'';
installPhase = ''
mv dist/ $out
'';
});
The packaging derivation works exactly how I want it. But the devshell does not. Specifically, while in the packaging derivation all the dependencies are installed and then all I need to do is run "pnpm build" in the build phase as shown. But in the dev shell when I execute "pnpm build" pnpm complains that I need to install the dependencies still.
Is there something I am missing? Is mkshell different from mkderivation in a way that prevents this? Obviously it is impure, but I'd like to confine the dependencies in the store as much as I can.
|