Skip to content

Commit f5646c9

Browse files
committed
enable prettier and reformat markdown
1 parent 2ae3807 commit f5646c9

File tree

5 files changed

+124
-127
lines changed

5 files changed

+124
-127
lines changed

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# nixos-anywhere
22

3-
***Install NixOS everywhere via ssh***
3+
**_Install NixOS everywhere via ssh_**
44

55
![](https://raw.githubusercontent.com/numtide/nixos-anywhere/main/docs/logo.png)
66

@@ -27,7 +27,7 @@ You first create Nix configurations to specify partitioning, formatting and NixO
2727
Once the configuration has been created, a single command will:
2828

2929
- Connect to the remote server via SSH
30-
- Detect whether a NixOS installer is present; if not, it will use the Linux ```kexec``` tool to boot into a Nixos installer.
30+
- Detect whether a NixOS installer is present; if not, it will use the Linux `kexec` tool to boot into a Nixos installer.
3131
- Use the [disko](https://github.com/nix-community/disko) tool to partition and format the hard drive
3232
- Install NixOS
3333
- Optionally install any Nix packages and other software required.
@@ -40,26 +40,23 @@ It's also possible to use **nixos-anywhere** to simplify the installation on a m
4040
## Prerequisites
4141

4242
- Source Machine:
43-
4443
- - Can be any Linux machine with Nix installed, or a NixOS machine.
4544
- Target Machine:
46-
47-
- Unless you're using the option to boot from a NixOS installer image, or providing your own ```kexec``` image, it must be running x86-64 Linux with kexec support. Most x86_64 Linux systems do have kexec support. By providing your own [image](./docs/how_to.md#using-your-own-kexec-image) you can also perform kexec for other architectures eg aarch64
48-
45+
46+
- Unless you're using the option to boot from a NixOS installer image, or providing your own `kexec` image, it must be running x86-64 Linux with kexec support. Most x86_64 Linux systems do have kexec support. By providing your own [image](./docs/how_to.md#using-your-own-kexec-image) you can also perform kexec for other architectures eg aarch64
4947
- Must have at least 1.5 GB of RAM, excluding swap.
50-
5148

5249
## How to use nixos-anywhere
5350

5451
Here’s  a quick summary of how to use **nixos-anywhere**. You can find more information in the [product documentation](./docs).
5552

5653
The tool doesn't need to be installed, since it can be run directly from this repository.
5754

58-
First create a repo that includes the disk configuration and a [flake](https://nixos.wiki/wiki/Flakes) to configure your options. This example assumes that flakes have been enabled on your source machine.
55+
First create a repo that includes the disk configuration and a [flake](https://nixos.wiki/wiki/Flakes) to configure your options. This example assumes that flakes have been enabled on your source machine.
5956

6057
Here’s an example of a simple disk configuration:
6158

62-
```
59+
```nix
6360
{ disks ? [ "/dev/vda" ], ... }:
6461
{
6562
disk = {
@@ -111,7 +108,7 @@ The [disko repository](https://github.com/nix-community/disko/tree/master/exampl
111108

112109
A simple flake may look like this:
113110

114-
```
111+
```nix
115112
{
116113
inputs.nixpkgs.url = github:NixOS/nixpkgs;
117114
inputs.disko.url = github:nix-community/disko;
@@ -178,7 +175,7 @@ If you would like to become a contributor, please see our [contribution guidelin
178175

179176
---
180177

181-
This project is supported by [Numtide](https://numtide.com/).  ![Untitledpng](https://codahosted.io/docs/6FCIMTRM0p/blobs/bl-sgSunaXYWX/077f3f9d7d76d6a228a937afa0658292584dedb5b852a8ca370b6c61dabb7872b7f617e603f1793928dc5410c74b3e77af21a89e435fa71a681a868d21fd1f599dd10a647dd855e14043979f1df7956f67c3260c0442e24b34662307204b83ea34de929d)    
178+
This project is supported by [Numtide](https://numtide.com/).  ![Untitledpng](https://codahosted.io/docs/6FCIMTRM0p/blobs/bl-sgSunaXYWX/077f3f9d7d76d6a228a937afa0658292584dedb5b852a8ca370b6c61dabb7872b7f617e603f1793928dc5410c74b3e77af21a89e435fa71a681a868d21fd1f599dd10a647dd855e14043979f1df7956f67c3260c0442e24b34662307204b83ea34de929d)
182179

183180
We are a team of independent freelancers that love open source.  We help our customers make their project lifecycles more efficient by:
184181

docs/howtos.md

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,40 @@
1-
# How To Guide: nixos-anywhere
2-
3-
## Contents
4-
5-
[Installing on a machine with no operating system](#installing-on-a-machine-with-no-operating-system)
6-
7-
[Using your own kexec image](#using-your-own-kexec-image)
8-
9-
[Using nixos-anywhere without flakes](#using-nixos-anywhere-without-flakes)
10-
11-
TODO: Add more topics
12-
13-
## Installing on a machine with no operating system
14-
15-
TODO: Still to be documented
16-
17-
Include:
18-
19-
`nixos-anywhere` can detect a nixos installer if it contains the identifier `VARIANT=installer` in its `/etc/os-release` file. This is the case for the nixos-unstable installer and will be also part of nixos 23.05. If an installer is detected `nixos-anywhere` will not try to kexec into its own image.
20-
21-
## Using your own kexec image
22-
23-
By default `nixos-anywhere` will download the kexec image from [here](https://github.com/nix-community/nixos-images#kexec-tarballs). It is also possible to provide your own by using the command line switch `--kexec` to specify the image file. The image will then be uploaded prior to executing.
24-
25-
```
26-
nixos-anywhere \
27-
--kexec "$(nix build --print-out-paths github:nix-community/nixos-images#packages.x86_64-linux.kexec-installer-noninteractive-nixos-unstable)/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz" \
28-
--flake 'github:your-user/your-repo#your-system' \
29-
root@yourip
30-
```
31-
32-
This is particularly useful for distributions like aarch64-linux, where there is no pre-build image. The following example assumes that your local machine can build for aarch64-linux either natively or through a remote builder
33-
34-
## Using nixos-anywhere without flakes
35-
36-
TODO: Add content
37-
38-
```
39-
40-
```
41-
42-
1+
# How To Guide: nixos-anywhere
2+
3+
## Contents
4+
5+
[Installing on a machine with no operating system](#installing-on-a-machine-with-no-operating-system)
6+
7+
[Using your own kexec image](#using-your-own-kexec-image)
8+
9+
[Using nixos-anywhere without flakes](#using-nixos-anywhere-without-flakes)
10+
11+
TODO: Add more topics
12+
13+
## Installing on a machine with no operating system
14+
15+
TODO: Still to be documented
16+
17+
Include:
18+
19+
`nixos-anywhere` can detect a nixos installer if it contains the identifier `VARIANT=installer` in its `/etc/os-release` file. This is the case for the nixos-unstable installer and will be also part of nixos 23.05. If an installer is detected `nixos-anywhere` will not try to kexec into its own image.
20+
21+
## Using your own kexec image
22+
23+
By default `nixos-anywhere` will download the kexec image from [here](https://github.com/nix-community/nixos-images#kexec-tarballs). It is also possible to provide your own by using the command line switch `--kexec` to specify the image file. The image will then be uploaded prior to executing.
24+
25+
```
26+
nixos-anywhere \
27+
--kexec "$(nix build --print-out-paths github:nix-community/nixos-images#packages.x86_64-linux.kexec-installer-noninteractive-nixos-unstable)/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz" \
28+
--flake 'github:your-user/your-repo#your-system' \
29+
root@yourip
30+
```
31+
32+
This is particularly useful for distributions like aarch64-linux, where there is no pre-build image. The following example assumes that your local machine can build for aarch64-linux either natively or through a remote builder
33+
34+
## Using nixos-anywhere without flakes
35+
36+
TODO: Add content
37+
38+
```
39+
40+
```

docs/quickstart.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Quickstart Guide: nixos-anywhere
2-
3-
This document describes how to use **nixos-anywhere** in its simplest case: installing NixOS on an existing Linux distribution via SSH.
4-
5-
TODO: Populate this guide
1+
# Quickstart Guide: nixos-anywhere
2+
3+
This document describes how to use **nixos-anywhere** in its simplest case: installing NixOS on an existing Linux distribution via SSH.
4+
5+
TODO: Populate this guide

docs/reference.md

Lines changed: 70 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,70 @@
1-
# Reference Manual: nixos-anywhere
2-
3-
TODO: Populate this guide properly
4-
5-
## Contents
6-
7-
[Command Line Usage](#command-line-usage)
8-
9-
[Developer guide](#developer-guide)
10-
11-
[Explanation of known error messages](#explanation-of-known-error-messages)
12-
13-
## Command Line Usage
14-
15-
<!-- `$ bash ./src/nixos-anywhere.sh --help` -->
16-
```
17-
Usage: nixos-anywhere [options] ssh-host
18-
19-
Options:
20-
21-
* -f, --flake flake
22-
set the flake to install the system from
23-
* -L, --print-build-logs
24-
print full build logs
25-
* -s, --store-paths
26-
set the store paths to the disko-script and nixos-system directly
27-
if this is give, flake is not needed
28-
* --no-reboot
29-
do not reboot after installation, allowing further customization of the target installation.
30-
* --kexec url
31-
use another kexec tarball to bootstrap NixOS
32-
* --stop-after-disko
33-
exit after disko formating, you can then proceed to install manually or some other way
34-
* --extra-files files
35-
files to copy into the new nixos installation
36-
* --disk-encryption-keys remote_path local_path
37-
copy the contents of the file or pipe in local_path to remote_path in the installer environment,
38-
after kexec but before installation. Can be repeated.
39-
* --no-substitute-on-destination
40-
disable passing --substitute-on-destination to nix-copy
41-
* --debug
42-
enable debug output
43-
* --option KEY VALUE
44-
nix option to pass to every nix related command
45-
* --from store-uri
46-
URL of the source Nix store to copy the nixos and disko closure from
47-
* --build-on-remote
48-
build the closure on the remote machine instead of locally and copy-closuring it
49-
```
50-
51-
## Developer guide
52-
53-
To run `nixos-anywhere` from the repo:
54-
55-
```shell
56-
nix run . -- --help
57-
```
58-
59-
To format the code
60-
61-
```shell
62-
nix fmt
63-
```
64-
65-
## Explanation of known error messages
66-
67-
TODO: List actual error messages and meanings. Include:
68-
69-
If you do not have enough RAM you will see failures unpacking the initrd), this is because kexec needs to load the whole nixos into memory.
1+
# Reference Manual: nixos-anywhere
2+
3+
TODO: Populate this guide properly
4+
5+
## Contents
6+
7+
[Command Line Usage](#command-line-usage)
8+
9+
[Developer guide](#developer-guide)
10+
11+
[Explanation of known error messages](#explanation-of-known-error-messages)
12+
13+
## Command Line Usage
14+
15+
<!-- `$ bash ./src/nixos-anywhere.sh --help` -->
16+
17+
```
18+
Usage: nixos-anywhere [options] ssh-host
19+
20+
Options:
21+
22+
* -f, --flake flake
23+
set the flake to install the system from
24+
* -L, --print-build-logs
25+
print full build logs
26+
* -s, --store-paths
27+
set the store paths to the disko-script and nixos-system directly
28+
if this is give, flake is not needed
29+
* --no-reboot
30+
do not reboot after installation, allowing further customization of the target installation.
31+
* --kexec url
32+
use another kexec tarball to bootstrap NixOS
33+
* --stop-after-disko
34+
exit after disko formating, you can then proceed to install manually or some other way
35+
* --extra-files files
36+
files to copy into the new nixos installation
37+
* --disk-encryption-keys remote_path local_path
38+
copy the contents of the file or pipe in local_path to remote_path in the installer environment,
39+
after kexec but before installation. Can be repeated.
40+
* --no-substitute-on-destination
41+
disable passing --substitute-on-destination to nix-copy
42+
* --debug
43+
enable debug output
44+
* --option KEY VALUE
45+
nix option to pass to every nix related command
46+
* --from store-uri
47+
URL of the source Nix store to copy the nixos and disko closure from
48+
* --build-on-remote
49+
build the closure on the remote machine instead of locally and copy-closuring it
50+
```
51+
52+
## Developer guide
53+
54+
To run `nixos-anywhere` from the repo:
55+
56+
```shell
57+
nix run . -- --help
58+
```
59+
60+
To format the code
61+
62+
```shell
63+
nix fmt
64+
```
65+
66+
## Explanation of known error messages
67+
68+
TODO: List actual error messages and meanings. Include:
69+
70+
If you do not have enough RAM you will see failures unpacking the initrd), this is because kexec needs to load the whole nixos into memory.

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
programs.nixpkgs-fmt.enable = true;
3232
programs.shellcheck.enable = true;
3333
programs.shfmt.enable = true;
34+
programs.prettier.enable = true;
3435
settings.formatter.shellcheck.options = [ "-s" "bash" ];
3536
};
3637
formatter = config.treefmt.build.wrapper;

0 commit comments

Comments
 (0)