node2nix icon indicating copy to clipboard operation
node2nix copied to clipboard

Cannot install `@angular/cli` because of Google’s Privacy Policy

Open timothee-haudebourg opened this issue 4 years ago • 4 comments

When I run nix-shell -A shell it fails when Google asks:

Would you like to share anonymous usage data with the Angular Team at Google under Google’s Privacy Policy at https://policies.google.com/privacy? For more details and how to change this setting, see https://angular.io/analytics. (y/N)

I tried by setting the environment variable NG_CLI_ANALYTICS to false beforehand as suggested, but it does not solve the issue.

timothee-haudebourg avatar Jul 11 '21 12:07 timothee-haudebourg

I'd like to add onto this by indicating that this has been fixed in tree for quite a while now.

I am still not sure why this is still an issue for many node<->nix projects, such as node2nix, nix-npm-buildpackage, etc.,

For nix-npm-buildpackage, I was able to work around the issue by setting NG_CLI_ANALYTICS = false in extraEnvVars, but I am not sure how to accomplish this with node2nix.

evanjs avatar Aug 19 '21 17:08 evanjs

Digging a bit further, I have to wonder how much of this is caused by the weird attribute name (@angular/cli), as most tools I've tried to use with said attribute... don't seem to like it very much.

For example, @angular/cli appears in the repl if I run e.g. nix repl "./override.nix" in my project. Can I query the value @angluar/cli? No Can I query the value as a string? Also no, it just returns a string... etc.

evanjs avatar Aug 19 '21 18:08 evanjs

I was able to build it with the following override:

{ pkgs ? import <nixpkgs> {
    inherit system;
  }
, system ? builtins.currentSystem
}:

let
  nodePackages = import ./default.nix {
    inherit pkgs system;
  };
in
nodePackages // {
  "@angular/cli" = nodePackages."@angular/cli".overrideAttrs (_: {
    NG_CLI_ANALYTICS = false;
  });
}

NobbZ avatar Sep 21 '21 18:09 NobbZ

@NobbZ yeah, this is what I've noticed in most JS/Nix libraries so far. For some reason, the in-tree override is not being used?

Not sure I understand the core problem, but the above should be helpful to those trying to use @angular/cli with this or similar JS/Nix projects, as well. Didn't realize I never really posted a "fully functional" workaround/example 😅

Thanks!

evanjs avatar Sep 21 '21 18:09 evanjs