Move node configuration
All checks were successful
/ check (push) Successful in 1m38s

This commit is contained in:
Oliver Davies 2025-07-28 01:47:41 +01:00
parent 3a6a2f0bcc
commit 5b00484567
5 changed files with 19 additions and 28 deletions

View file

@ -6,7 +6,6 @@
features = { features = {
cli = { cli = {
bookmarkthis.enable = true; bookmarkthis.enable = true;
node.enable = true;
starship.enable = true; starship.enable = true;
zsh.enable = true; zsh.enable = true;
}; };

View file

@ -9,7 +9,6 @@
features = { features = {
cli = { cli = {
bookmarkthis.enable = true; bookmarkthis.enable = true;
node.enable = true;
starship.enable = true; starship.enable = true;
zsh.enable = true; zsh.enable = true;
}; };

View file

@ -2,7 +2,6 @@
imports = [ imports = [
./bookmarkthis.nix ./bookmarkthis.nix
./dev-commit.nix ./dev-commit.nix
./node.nix
./starship.nix ./starship.nix
./zsh ./zsh
]; ];

View file

@ -1,25 +0,0 @@
{ config, lib, ... }:
with lib;
let
cfg = config.features.cli.node;
inherit (config.xdg) configHome dataHome stateHome;
in
{
options.features.cli.node.enable = mkEnableOption "Enable node";
config = mkIf cfg.enable {
xdg.configFile."${config.home.sessionVariables.NPM_CONFIG_USERCONFIG}".text = ''
cache=${configHome}/npm
init-module=${configHome}/npm/config/npm-init.js
logs-dir=${stateHome}/npm/logs
prefix=${dataHome}/npm
'';
home.sessionVariables = {
NPM_CONFIG_USERCONFIG = "${configHome}/npm/npmrc";
};
};
}

19
modules2/node.nix Normal file
View file

@ -0,0 +1,19 @@
{
flake.modules.homeManager.base =
{ config, ... }:
let
inherit (config.xdg) configHome dataHome stateHome;
in
{
xdg.configFile."${config.home.sessionVariables.NPM_CONFIG_USERCONFIG}".text = ''
cache=${configHome}/npm
init-module=${configHome}/npm/config/npm-init.js
logs-dir=${stateHome}/npm/logs
prefix=${dataHome}/npm
'';
home.sessionVariables = {
NPM_CONFIG_USERCONFIG = "${configHome}/npm/npmrc";
};
};
}