From d009db528d20b7fce1ef54e68e530ead64b5786e Mon Sep 17 00:00:00 2001 From: Dani Date: Wed, 6 Jan 2021 00:05:03 +0100 Subject: [PATCH] docs(installation): add advanced installation (#1643) Adds an "Advanced Installation" page to the documentation website. --- README.md | 13 ++++------ docs/.vuepress/config.js | 1 + docs/installing/README.md | 52 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 docs/installing/README.md diff --git a/README.md b/README.md index 28a4a42c..2191f282 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,9 @@ ### Getting Started +**Note**: due to the proliferation of different platforms, only a subset of supported platforms are +shown below. Can't see yours? Have a look at the [extra platform instructions](https://starship.rs/installing/). + 1. Install the **starship** binary: #### Install Latest Version @@ -149,15 +152,9 @@ curl -fsSL https://starship.rs/install.sh | bash ``` - ##### From source on [crates.io](https://crates.io/): - - ```sh - cargo install starship - ``` - #### Install via Package Manager - ##### With [Homebrew](https://brew.sh/): + ##### Example: [Homebrew](https://brew.sh/): ```sh brew install starship @@ -169,7 +166,7 @@ scoop install starship ``` -1. Add the init script to your shell's config file: +2. Add the init script to your shell's config file: #### Bash diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 1f05e8f3..0d23a105 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -90,6 +90,7 @@ module.exports = { sidebar: [ "/", ["/guide/", "Guide"], + ["/installing/", "Advanced Installation"], ["/config/", "Configuration"], ["/advanced-config/", "Advanced Configuration"], ["/faq/", "Frequently Asked Questions"], diff --git a/docs/installing/README.md b/docs/installing/README.md new file mode 100644 index 00000000..45b21fad --- /dev/null +++ b/docs/installing/README.md @@ -0,0 +1,52 @@ +# 🚀 Advanced Installation + +To install starship, you need to do two things: + +1. Get the **starship** binary onto your computer +1. Tell your shell to use the starship binary as its prompt by modifying its init scripts + +For most users, the instructions on [the main page](/guide/#🚀-installation) will work great. However, +for some more specialized platforms, different instructions are needed. + +There are so many platforms out there that they didn't fit into the main +README.md file, so here are some installation instructions for other platforms +from the community. Is yours not here? Please do add it here if you figure it +out! + +## [Nix](https://nixos.wiki/wiki/Nix) + +### Getting the Binary + +#### Imperatively + +```sh +nix-env -iA nixos.starship +``` + +#### Declarative, single user, via [home-manager](home-manager) + +Add `pkgs.starship` to your `home.packages` in your `home.nix` file, then run + +```sh +home-manager switch +``` + +#### Declarative, system-wide, with NixOS + +Add `pkgs.starship` to `environment.packages` in your `configuration.nix`, +then run + +```sh +sudo nixos-rebuild switch +``` + +### Modifying Init Scripts + +#### With Nix and home-manager, using zsh: + +Add the following to `programs.zsh.initExtra` in your `home.nix` file, then +run + +```sh +home-manager switch +```