staging again
This commit is contained in:
parent
4cea0a966e
commit
ad06ac826e
3 changed files with 41 additions and 1 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
rpcs3
|
rpcs3
|
||||||
ryujinx
|
ryujinx
|
||||||
mupen64plus
|
mupen64plus
|
||||||
dolphin-emulator
|
dolphin-emu
|
||||||
retroarch
|
retroarch
|
||||||
mednafen
|
mednafen
|
||||||
joycond
|
joycond
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,11 @@
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
../modules/python.nix
|
../modules/python.nix
|
||||||
|
../modules/npm.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
python.enable = true;
|
python.enable = true;
|
||||||
|
npm.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
brave # TODO: make a module to save browser stuff
|
brave # TODO: make a module to save browser stuff
|
||||||
|
|
|
||||||
38
modules/npm.nix
Normal file
38
modules/npm.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
npmConf = pkgs.writeText "npmrc" ''
|
||||||
|
prefix=${config.environment.variables.NPM_CONFIG_PREFIX}
|
||||||
|
cache=$HOME/.npm
|
||||||
|
init-module=$HOME/.npm-init.js
|
||||||
|
node-linker=hoisted
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
options.npm = {
|
||||||
|
enable = lib.mkEnableOption "System NPM Environment";
|
||||||
|
};
|
||||||
|
config = lib.mkIf config.npm.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nodejs
|
||||||
|
nodePackages.npm
|
||||||
|
];
|
||||||
|
environment.variables = {
|
||||||
|
NPM_CONFIG_PREFIX = "$HOME/.npm-global";
|
||||||
|
PATH = ["$HOME/.npm-global/bin"];
|
||||||
|
NPM_CONFIG_USERCONFIG = "${npmConf}";
|
||||||
|
};
|
||||||
|
system.userActivationScripts.setupNpm = ''
|
||||||
|
mkdir -p $HOME/.npm-global/bin
|
||||||
|
mkdir -p $HOME/.npm
|
||||||
|
if [ ! -f "$HOME/.npmrc" ]; then
|
||||||
|
cp ${npmConf} $HOME/.npmrc
|
||||||
|
fi
|
||||||
|
if [ -d "$HOME/.npm-global" ]; then
|
||||||
|
chmod -R +rw $HOME/.npm-global
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue