Created
July 11, 2018 21:47
-
-
Save StephenFluin/0f06b4a575c7e08e556b78469e18e912 to your computer and use it in GitHub Desktop.
Install Angular on a *nix system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # NVM | |
| curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
| nvm install 10 | |
| # Yarn | |
| curl -o- -L https://yarnpkg.com/install.sh | bash | |
| export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" | |
| yarn global add @angular/cli |
You could run it via nix-shell
with import <nixpkgs> {}; stdenv.mkDerivation rec { name = "ng"; env = buildEnv { name = name; paths = buildInputs; }; buildInputs = [ nodejs-12_x yarn nodePackages."@angular/cli" ]; }
Not anymore, you cant
your are right:
{
description = "Angular something";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
in {
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs_24
yarn
(writeShellScriptBin "ng" ''
exec ${lib.getExe' nodejs_24 "npx"} --yes @angular/cli@22 "$@"
'')
];
};
});
};
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could run it via nix-shell