Skip to content

Commit

Permalink
reformat tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 authored and mergify[bot] committed Sep 17, 2023
1 parent 1be23d7 commit 9ab9637
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 73 deletions.
66 changes: 47 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,52 @@

[Documentation Index](./docs/INDEX.md)

NixOS is a Linux distribution where everything is described as code, with one exception: during installation, the disk partitioning and formatting are manual steps. **disko** aims to correct this sad 🤡 omission.
NixOS is a Linux distribution where everything is described as code, with one
exception: during installation, the disk partitioning and formatting are manual
steps. **disko** aims to correct this sad 🤡 omission.

This is especially useful for unattended installations, re-installation after a system crash or for setting up more than one identical server.
This is especially useful for unattended installations, re-installation after a
system crash or for setting up more than one identical server.

## Overview

**disko** can either be used after booting from a NixOS installer, or in conjunction with [nixos-anywhere](https://github.com/numtide/nixos-anywhere) if you're installing remotely.
**disko** can either be used after booting from a NixOS installer, or in
conjunction with [nixos-anywhere](https://github.com/numtide/nixos-anywhere) if
you're installing remotely.

Before using **disko**, the specifications of the disks, partitions, type of formatting and the mount points must be defined in a Nix configuration. You can find [examples](./example) of typical configurations in the Nix community repository, and use one of these as the basis of your own configuration.
Before using **disko**, the specifications of the disks, partitions, type of
formatting and the mount points must be defined in a Nix configuration. You can
find [examples](./example) of typical configurations in the Nix community
repository, and use one of these as the basis of your own configuration.

You can keep your configuration and re-use it for other installations, or for a system rebuild.
You can keep your configuration and re-use it for other installations, or for a
system rebuild.

**disko** is flexible, in that it supports most of the common formatting and partitioning options, including:
**disko** is flexible, in that it supports most of the common formatting and
partitioning options, including:

- Disk layouts: GPT, MBR, and mixed.
- Partition tools: LVM, mdadm, LUKS, and more.
- Filesystems: ext4, btrfs, ZFS, bcachefs, tmpfs, and others.

It can work with these in various configurations and orders, and supports recursive layouts.
It can work with these in various configurations and orders, and supports
recursive layouts.

## How to use disko

Disko doesn't require installation: it can be run directly from nix-community repository. The [Quickstart Guide](./docs/quickstart.md) documents how to run Disko in its simplest form when installing NixOS.
Disko doesn't require installation: it can be run directly from nix-community
repository. The [Quickstart Guide](./docs/quickstart.md) documents how to run
Disko in its simplest form when installing NixOS.

For information on other use cases, including upgrading from an older version of **disko**, using **disko** without NixOS and downloading the module, see the [How To Guide](./docs/HowTo.md)
For information on other use cases, including upgrading from an older version of
**disko**, using **disko** without NixOS and downloading the module, see the
[How To Guide](./docs/HowTo.md)

For more detailed options, such as command line switches, see the [Reference Guide](./docs/reference.md)
For more detailed options, such as command line switches, see the
[Reference Guide](./docs/reference.md)

To access sample configurations for commonly-used disk layouts, refer to the [examples](./example) provided.
To access sample configurations for commonly-used disk layouts, refer to the
[examples](./example) provided.

## Sample Configuration and CLI command

Expand Down Expand Up @@ -72,34 +89,45 @@ A simple disko configuration may look like this:
}
```

If you'd saved this configuration in /tmp/disko-config.nix, and wanted to create a disk named /dev/nvme0n1, you would run the following command to partition, format and mount the disk.
If you'd saved this configuration in /tmp/disko-config.nix, and wanted to create
a disk named /dev/nvme0n1, you would run the following command to partition,
format and mount the disk.

```
$ sudo nix run github:nix-community/disko -- --mode disko /tmp/disko-config.nix --arg disks '[ "/dev/nvme0n1" ]'
```

## Related Tools

This tool is used by [nixos-anywhere](https://github.com/numtide/nixos-anywhere), which carries out a fully-automated remote install of NixOS.
This tool is used by
[nixos-anywhere](https://github.com/numtide/nixos-anywhere), which carries out a
fully-automated remote install of NixOS.

We also acknowledge https://github.com/NixOS/nixpart, the conceptual ancestor of this project.
We also acknowledge https://github.com/NixOS/nixpart, the conceptual ancestor of
this project.

## Licensing and Contribution details

This software is provided free under the [MIT Licence](https://opensource.org/licenses/MIT).
This software is provided free under the
[MIT Licence](https://opensource.org/licenses/MIT).

If you would like to become a contributor, please see our [contribution guidelines.](https://github.com/numtide/docs/contribution-guidelines.md)
If you would like to become a contributor, please see our
[contribution guidelines.](https://github.com/numtide/docs/contribution-guidelines.md)

---

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

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

- Providing and supporting useful tools such as this one
- Building and deploying infrastructure, and offering dedicated DevOps support
- Building their in-house Nix skills, and integrating Nix with their workflows
- Developing additional features and tools
- Carrying out custom research and development.

[Contact us](https://numtide.com/contact) if you have a project in mind, or if you need help with any of our supported tools, including this one. We'd love to hear from you.
[Contact us](https://numtide.com/contact) if you have a project in mind, or if
you need help with any of our supported tools, including this one. We'd love to
hear from you.
29 changes: 18 additions & 11 deletions docs/HowTo.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ TODO: Still to be documented

TODO: Include documentation here.

For now, see the [upgrade guide](https://github.com/JillThornhill/disko/blob/master/docs/upgrade-guide.md)
For now, see the
[upgrade guide](https://github.com/JillThornhill/disko/blob/master/docs/upgrade-guide.md)

## Installing NixOS module

Expand All @@ -19,7 +20,7 @@ You can use the NixOS module in one of the following ways:

If you use nix flakes support:

``` nix
```nix
{
inputs.disko.url = "github:nix-community/disko";
inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
Expand All @@ -37,54 +38,57 @@ If you use nix flakes support:
};
}
```

</details>
<details>
<summary>niv</summary>

First add it to [niv](https://github.com/nmattia/niv):
First add it to [niv](https://github.com/nmattia/niv):

```console
$ niv add nix-community/disko
```

Then add the following to your configuration.nix in the `imports` list:
Then add the following to your configuration.nix in the `imports` list:

```nix
{
imports = [ "${(import ./nix/sources.nix).disko}/modules/disko.nix" ];
}
```

</details>
<details>
<summary>nix-channel</summary>

As root run:
As root run:

```console
$ nix-channel --add https://github.com/nix-community/disko/archive/master.tar.gz disko
$ nix-channel --update
```

Then add the following to your configuration.nix in the `imports` list:
Then add the following to your configuration.nix in the `imports` list:

```nix
{
imports = [ <disko/modules/disko.nix> ];
}
```

</details>
<details>
<summary>fetchTarball</summary>

Add the following to your configuration.nix:
Add the following to your configuration.nix:

``` nix
```nix
{
imports = [ "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix" ];
}
```

or with pinning:
or with pinning:

```nix
{
Expand All @@ -100,6 +104,7 @@ $ nix-channel --update
];
}
```

</details>

## Using the NixOS module
Expand Down Expand Up @@ -145,8 +150,10 @@ $ nix-channel --update
}
```

this will configure `fileSystems` and other required NixOS options to boot the specified configuration.
this will configure `fileSystems` and other required NixOS options to boot the
specified configuration.

If you are on an installer, you probably want to disable `enableConfig`.

disko will create the scripts `disko-create` and `disko-mount` which can be used to create/mount the configured disk layout.
disko will create the scripts `disko-create` and `disko-mount` which can be used
to create/mount the configured disk layout.
Loading

0 comments on commit 9ab9637

Please sign in to comment.