Pre Install script
Opened this issue · 2 comments
husseinraoouf commented
I am trying to install @angular/cli with yarn2nix but it fails because of google analytics prompt in the postinstall script
Luckily i can disable it by setting the environment variable NG_CLI_ANALYTICS=ci
but i don't know where to put it in the mkYarnPackage
thanks
zimbatm commented
try this argument:
mkYarnPackage {
# ... the usual here ...
yarnPreBuild = ''
export NG_CLI_ANALYTICS=ci
'';
}
husseinraoouf commented
sorry for late reply
i have tried what you suggested but it didn't solve the problem
that is how i am using mkYarnPackage
node.nix
{ pkgs ? import <nixpkgs> {} }:
with (import (builtins.fetchTarball https://github.com/moretea/yarn2nix/archive/master.tar.gz) { inherit pkgs; });
mkYarnPackage {
src = ./.;
yarnPreBuild = ''
export NG_CLI_ANALYTICS=ci
'';
}
configuration.nix
{ config, pkgs, system, ... }:
let
nodePackages = pkgs.nodePackages // import ./node.nix { inherit pkgs; };
in
{
# emited code
environment.systemPackages = with pkgs; [
nodePackages."@angular/cli"
# emited code
];
# emited code
}