mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 10:18:37 +02:00
feat(home/linux/base): make npm install -g <pkg> happey
This commit is contained in:
9
home/base/core/npm.nix
Normal file
9
home/base/core/npm.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{config, ...}: {
|
||||||
|
# make `npm install -g <pkg>` happey
|
||||||
|
#
|
||||||
|
# mainly used to install npm packages that updates frequently
|
||||||
|
# such as gemini-cli, claude-code, etc.
|
||||||
|
home.file.".npmrc".text = ''
|
||||||
|
prefix=${config.home.homeDirectory}/.npm
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -1,8 +1,4 @@
|
|||||||
{
|
{config, ...}: let
|
||||||
config,
|
|
||||||
pkgs-unstable,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
k = "kubectl";
|
k = "kubectl";
|
||||||
|
|
||||||
@@ -13,22 +9,24 @@
|
|||||||
localBin = "${config.home.homeDirectory}/.local/bin";
|
localBin = "${config.home.homeDirectory}/.local/bin";
|
||||||
goBin = "${config.home.homeDirectory}/go/bin";
|
goBin = "${config.home.homeDirectory}/go/bin";
|
||||||
rustBin = "${config.home.homeDirectory}/.cargo/bin";
|
rustBin = "${config.home.homeDirectory}/.cargo/bin";
|
||||||
|
npmBin = "${config.home.homeDirectory}/.npm/bin";
|
||||||
in {
|
in {
|
||||||
# only works in bash/zsh, not nushell
|
programs.bash = {
|
||||||
|
enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
bashrcExtra = ''
|
||||||
|
export PATH="$PATH:${localBin}:${goBin}:${rustBin}:${npmBin}"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# NOTE: only works in bash/zsh, not nushell
|
||||||
home.shellAliases = shellAliases;
|
home.shellAliases = shellAliases;
|
||||||
|
|
||||||
|
# NOTE: nushell will be launched in bash, so it can inherit all the eenvironment variables.
|
||||||
programs.nushell = {
|
programs.nushell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# package = pkgs-unstable.nushell;
|
# package = pkgs-unstable.nushell;
|
||||||
configFile.source = ./config.nu;
|
configFile.source = ./config.nu;
|
||||||
inherit shellAliases;
|
inherit shellAliases;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.bash = {
|
|
||||||
enable = true;
|
|
||||||
enableCompletion = true;
|
|
||||||
bashrcExtra = ''
|
|
||||||
export PATH="$PATH:${localBin}:${goBin}:${rustBin}"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user