moved
This commit is contained in:
parent
de4b14a35d
commit
37346c49e0
23 changed files with 12 additions and 39 deletions
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
npmConf = pkgs.writeText "npmrc" ''
|
||||
prefix=${"$"}{HOME}/.npm-global
|
||||
cache=${"$"}{HOME}/.npm
|
||||
init-module=${"$"}{HOME}/.npm-init.js
|
||||
'';
|
||||
in {
|
||||
options.npm.enable = lib.mkEnableOption "system-wide npm environment";
|
||||
|
||||
config = lib.mkIf config.npm.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
nodejs_22
|
||||
nodePackages.npm
|
||||
yarn
|
||||
bun
|
||||
pnpm
|
||||
electron
|
||||
nodePackages.typescript
|
||||
nodePackages.prettier
|
||||
nodePackages.eslint
|
||||
nodePackages.sql-formatter
|
||||
nodePackages.markdownlint-cli
|
||||
nodePackages.stylelint
|
||||
nodePackages.htmlhint
|
||||
nodePackages.jsonlint
|
||||
];
|
||||
|
||||
environment.sessionVariables.PATH =
|
||||
lib.mkAfter ":${"$"}{HOME}/.npm-global/bin";
|
||||
|
||||
environment.etc."npmrc".source = npmConf;
|
||||
|
||||
systemd.user.services."npm-setup" = {
|
||||
description = "Install .npmrc";
|
||||
wantedBy = ["default.target"];
|
||||
script = ''
|
||||
install -m600 -D ${npmConf} "$HOME/.npmrc"
|
||||
'';
|
||||
serviceConfig.Type = "oneshot";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue