not much progress tbh
Some checks failed
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Failing after 9s
Some checks failed
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Failing after 9s
This commit is contained in:
parent
4e2fe3700d
commit
a7a53e6fb6
504 changed files with 15 additions and 552 deletions
21
flake.nix
21
flake.nix
|
|
@ -11,35 +11,26 @@
|
|||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
node = pkgs.nodejs_22; # or pkgs.nodejs_20
|
||||
|
||||
|
||||
start = pkgs.writeShellApplication {
|
||||
name = "start";
|
||||
runtimeInputs = [ node ];
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
export npm_config_cache="$PWD/.npm-cache"
|
||||
[ -f .env ] && set -a && . ./.env && set +a
|
||||
if [ -f package-lock.json ]; then cmd=ci; else cmd=install; fi
|
||||
echo "→ npm $cmd (nix run)"
|
||||
${node}/bin/npm "$cmd"
|
||||
exec ${node}/bin/npm run dev -- "$@"
|
||||
|
||||
'';
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [ node ];
|
||||
shellHook = ''
|
||||
export npm_config_cache="$PWD/.npm-cache"
|
||||
# if [ -f package-lock.json ]; then cmd=ci; else cmd=install; fi
|
||||
# echo "→ npm $cmd (dev shell)"
|
||||
# ${node}/bin/npm "$cmd"
|
||||
'';
|
||||
};
|
||||
|
||||
apps.default = {
|
||||
type = "app";
|
||||
program = "${start}/bin/start";
|
||||
};
|
||||
devShells.default = pkgs.mkShell { buildInputs = [ node ]; shellHook = ''export npm_config_cache="$PWD/.npm-cache"''; };
|
||||
apps.default = { type = "app"; program = "${start}/bin/start"; };
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue