docs(web): replace console with bash
This gives us a cute "Terminal Window Look" for these code blocks. Change-Id: I87fbb739917cef692c692585e7ff569d3da66435 Reviewed-on: https://cl.snix.dev/c/snix/+/30449 Reviewed-by: Vova Kryachko <v.kryachko@gmail.com> Tested-by: besadii Autosubmit: Florian Klink <flokli@flokli.de>
This commit is contained in:
parent
21628f7ad4
commit
8b04f098da
3 changed files with 34 additions and 35 deletions
|
|
@ -29,13 +29,13 @@ Snix is hosted in its own Forgejo instance, hosted on [git.snix.dev](https://git
|
|||
|
||||
Check out the source code as follows:
|
||||
|
||||
```console
|
||||
$ git clone https://git.snix.dev/snix/snix.git
|
||||
```bash
|
||||
git clone https://git.snix.dev/snix/snix.git
|
||||
```
|
||||
|
||||
### Interactive development
|
||||
```console
|
||||
$ direnv allow
|
||||
```bash
|
||||
direnv allow
|
||||
```
|
||||
|
||||
This provides all the necessary tools and dependencies to interactively build
|
||||
|
|
@ -47,14 +47,14 @@ It is also possible to build the different Snix crates with Nix,
|
|||
in which you don't need to enter the shell.
|
||||
From the root of the repository, you can build as follows:
|
||||
|
||||
```console
|
||||
```bash
|
||||
$ nix-build -A snix.cli
|
||||
```
|
||||
|
||||
Alternatively, you can use the `mg` wrapper from anywhere in the repository (requires the direnv setup from above):
|
||||
|
||||
```console
|
||||
$ mg build //snix:cli
|
||||
```bash
|
||||
mg build //snix:cli
|
||||
```
|
||||
|
||||
This uses [crate2nix][] to build each crate dependency individually.
|
||||
|
|
|
|||
|
|
@ -42,14 +42,14 @@ interact with Gerrit directly.
|
|||
Replace `$USER` with your `Username` shown in the Gerrit settings.
|
||||
|
||||
#### If using SSH authentication:
|
||||
```console
|
||||
$ git remote set-url origin "ssh://$USER@cl.snix.dev:29418/snix"
|
||||
```bash
|
||||
git remote set-url origin "ssh://$USER@cl.snix.dev:29418/snix"
|
||||
```
|
||||
|
||||
|
||||
#### If using HTTP authentication:
|
||||
```console
|
||||
$ git remote set-url origin "https://$USER@cl.snix.dev/a/snix"
|
||||
```bash
|
||||
git remote set-url origin "https://$USER@cl.snix.dev/a/snix"
|
||||
```
|
||||
|
||||
<!-- TODO: fix replication to include refs/changes/… etc, and ensure it
|
||||
|
|
@ -62,10 +62,10 @@ updates of old commits, and track them as new revisions of the same "CL" [^2].
|
|||
|
||||
To install the commit-msg hook, run the following from the repo root:
|
||||
|
||||
```console
|
||||
$ mkdir -p .git/hooks
|
||||
$ curl -Lo .git/hooks/commit-msg https://cl.snix.dev/tools/hooks/commit-msg
|
||||
$ chmod +x .git/hooks/commit-msg
|
||||
```bash
|
||||
mkdir -p .git/hooks
|
||||
curl -Lo .git/hooks/commit-msg https://cl.snix.dev/tools/hooks/commit-msg
|
||||
chmod +x .git/hooks/commit-msg
|
||||
```
|
||||
|
||||
{{< callout context="tip" title="Did you know?" icon="outline/rocket" >}}
|
||||
|
|
@ -78,8 +78,8 @@ If you already have some local commits without `Change-Id` field, `git commit
|
|||
### Push your changes
|
||||
Do some local changes, and push them to Gerrit as follows:
|
||||
|
||||
```console
|
||||
$ git push origin HEAD:refs/for/canon
|
||||
```bash
|
||||
git push origin HEAD:refs/for/canon
|
||||
```
|
||||
|
||||
Gerrit will print links to newly created CLs to your terminal.
|
||||
|
|
@ -109,8 +109,8 @@ Some more tips:
|
|||
You can immediately assign reviewers and other fields while pushing a
|
||||
new/updated change, by adding it to the push URL.
|
||||
|
||||
```console
|
||||
$ git push origin HEAD:refs/for/canon%r=alice,cc=bob,l=Autosubmit+1,publish-comments
|
||||
```bash
|
||||
git push origin HEAD:refs/for/canon%r=alice,cc=bob,l=Autosubmit+1,publish-comments
|
||||
```
|
||||
* will set `alice` as a reviewer
|
||||
* will set `bob` as CC
|
||||
|
|
|
|||
|
|
@ -18,9 +18,8 @@ This document describes how to configure `snix` as the lower layer in your
|
|||
To use this feature you will need to 2 `snix` compontents, for detailed building
|
||||
instructions see [Building]({{< ref "building" >}}).
|
||||
|
||||
```console
|
||||
$ nix-build -A snix.store
|
||||
$ nix-build -A snix.nix-daemon
|
||||
```bash
|
||||
nix-build -A snix.store -A snix.nix-daemon
|
||||
```
|
||||
|
||||
These will provide `snix-store` and `nix-daemon` binaries.
|
||||
|
|
@ -35,8 +34,8 @@ customization instructions.
|
|||
|
||||
You can run the daemon with:
|
||||
|
||||
```console
|
||||
$ $(nix-build -A snix.snix-store)/bin/snix-store daemon
|
||||
```bash
|
||||
$(nix-build -A snix.snix-store)/bin/snix-store daemon
|
||||
```
|
||||
|
||||
### Mount the store
|
||||
|
|
@ -44,8 +43,8 @@ $ $(nix-build -A snix.snix-store)/bin/snix-store daemon
|
|||
To expose the store paths and their contents as a file system, if can be
|
||||
FUSE-mounted with the following command:
|
||||
|
||||
```console
|
||||
$ $(nix-build -A snix.snix-store)/bin/snix-store mount /path/to/mount
|
||||
```bash
|
||||
$(nix-build -A snix.snix-store)/bin/snix-store mount /path/to/mount
|
||||
```
|
||||
|
||||
This mount will talk to the previously invoked daemon.
|
||||
|
|
@ -56,8 +55,8 @@ be careful with it if your store is really large.
|
|||
|
||||
### Run `snix` nix-daemon
|
||||
|
||||
```console
|
||||
$ $(nix-build -A snix.nix-daemon)/bin/nix-daemon -l /tmp/snix-daemon.sock \
|
||||
```bash
|
||||
$(nix-build -A snix.nix-daemon)/bin/nix-daemon -l /tmp/snix-daemon.sock \
|
||||
--unix-listen-unlink
|
||||
```
|
||||
|
||||
|
|
@ -84,15 +83,15 @@ Bind mount your real /nix store on the side, so that nix has direct access to
|
|||
it, this is optional but allows you to have access to your real nix store
|
||||
without unmounting:
|
||||
|
||||
```console
|
||||
$ mount --bind /nix /opt/nix
|
||||
```bash
|
||||
mount --bind /nix /opt/nix
|
||||
```
|
||||
|
||||
```console
|
||||
$ mount -t overlay overlay \
|
||||
-o lowerdir=/path/to/mount \
|
||||
-o upperdir=/opt/nix \
|
||||
/nix
|
||||
```bash
|
||||
mount -t overlay overlay \
|
||||
-o lowerdir=/path/to/mount \
|
||||
-o upperdir=/opt/nix \
|
||||
/nix
|
||||
```
|
||||
|
||||
### Configure nix to use the daemon
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue