mirror of
https://github.com/sajenim/javascript-template.git
synced 2025-12-17 03:50:40 +08:00
- Add Node.js to devshell for mature, stable REPL - Create .replrc.js with println() and dir() helpers - Add 'just repl' command with auto-loaded helpers - Add 'just add-dev' and 'just remove' for package management - Update README with complete command reference and feature list
44 lines
906 B
Nix
44 lines
906 B
Nix
{inputs, lib, ...}: let
|
|
# FHS compatibility for NixOS (steam-run wrapper)
|
|
# Enable if bun-installed binaries fail to find system libraries
|
|
fhs = false;
|
|
in {
|
|
perSystem = {system, ...}: let
|
|
pkgs = import inputs.nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = fhs;
|
|
};
|
|
|
|
fhsPackages = lib.optionals fhs [
|
|
pkgs.steam-run
|
|
];
|
|
|
|
fhsSetup = lib.optionalString fhs ''
|
|
alias bun="steam-run bun"
|
|
'';
|
|
in {
|
|
devShells.default = pkgs.mkShell {
|
|
nativeBuildInputs = with pkgs;
|
|
[
|
|
bun
|
|
nodejs
|
|
eslint
|
|
just
|
|
prettierd
|
|
]
|
|
++ fhsPackages;
|
|
|
|
shellHook = ''
|
|
${fhsSetup}
|
|
|
|
if [ -f package.json ]; then
|
|
echo "Installing dependencies..."
|
|
bun install
|
|
fi
|
|
|
|
echo ""
|
|
echo "💡 Run 'just' to see available commands"
|
|
'';
|
|
};
|
|
};
|
|
}
|