Skip to content

Commit

Permalink
theo: Fix npm warning about tmp setting
Browse files Browse the repository at this point in the history
`NPM_CONFIG_TMP` variable triggered annoying warning for every invocation of any `npm` command:

    npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
    npm WARN config location in the cache, and they are managed by
    npm WARN config     [`cacache`](http://npm.im/cacache).

While at it, let’s also manage the npm config with home-manager and move the cache path setting to there.
  • Loading branch information
jtojnar committed Jul 13, 2022
1 parent cd20d8b commit 3783acb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions common/data/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ set -x CARGO_HOME $XDG_DATA_HOME/cargo
set -x CCACHE_DIR $XDG_CACHE_HOME/ccache
set -x GNUPGHOME $XDG_DATA_HOME/gnupg
set -x GTK2_RC_FILES $XDG_CONFIG_HOME/gtk-2.0/gtkrc
set -x NPM_CONFIG_USERCONFIG $XDG_CONFIG_HOME/npm/config
set -x NPM_CONFIG_CACHE $XDG_CACHE_HOME/npm
set -x NPM_CONFIG_TMP $XDG_RUNTIME_DIR/npm
set -x NPM_CONFIG_USERCONFIG $XDG_CONFIG_HOME/npm/npmrc
set -x RUSTUP_HOME $XDG_DATA_HOME/rustup
set -x STACK_ROOT $XDG_DATA_HOME/stack
set -x WEECHAT_HOME $XDG_CONFIG_HOME/weechat
Expand Down
5 changes: 5 additions & 0 deletions hosts/theo/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,11 @@ in {
};
};

home.file.".config/npm/npmrc".text = ''
prefix=''${XDG_DATA_HOME}/npm
cache=''${XDG_CACHE_HOME}/npm
'';

home.file.".config/mozc/ibus_config.textproto".text = ''
# `ibus write-cache; ibus restart` might be necessary to apply changes.
engines {
Expand Down

0 comments on commit 3783acb

Please sign in to comment.