npm packages and ulimit
This commit is contained in:
@@ -62,6 +62,9 @@ in
|
||||
};
|
||||
stateVersion = "23.11";
|
||||
};
|
||||
|
||||
home.activation.ensureNpmCliTools = import ./npm.nix { inherit lib pkgs; };
|
||||
|
||||
catppuccin = {
|
||||
autoEnable = true;
|
||||
enable = true;
|
||||
@@ -184,6 +187,7 @@ in
|
||||
initContent =
|
||||
let
|
||||
zshConfigEarlyInit = lib.mkOrder 500 ''
|
||||
ulimit -n 524288
|
||||
if [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]]; then
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
. /nix/var/nix/profiles/default/etc/profile.d/nix.sh
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
{ lib, pkgs }:
|
||||
|
||||
let
|
||||
npmPackages = [
|
||||
"@enact/cli"
|
||||
"@webos-tools/cli"
|
||||
"patch-package"
|
||||
];
|
||||
in
|
||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
# Ensure required npm CLI tools are installed in the user prefix.
|
||||
NPM_BIN="${pkgs.nodejs}/bin/npm"
|
||||
export NPM_CONFIG_PREFIX="$HOME/.npm-packages"
|
||||
export PATH="${pkgs.nodejs}/bin:$NPM_CONFIG_PREFIX/bin:$PATH"
|
||||
|
||||
if [[ ! -x "$NPM_BIN" ]]; then
|
||||
echo "npm not found; skipping npm CLI installation step"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for pkg in ${lib.concatStringsSep " " (map lib.escapeShellArg npmPackages)}; do
|
||||
if "$NPM_BIN" list -g --depth=0 "$pkg" >/dev/null 2>&1; then
|
||||
echo "npm package already installed: $pkg"
|
||||
else
|
||||
echo "installing npm package: $pkg"
|
||||
"$NPM_BIN" install -g "$pkg"
|
||||
fi
|
||||
done
|
||||
''
|
||||
Reference in New Issue
Block a user