mirror of
https://github.com/nix-community/disko.git
synced 2024-11-04 05:44:29 +03:00
parent
44e97d4197
commit
1b19111387
@ -95,7 +95,7 @@ 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,
|
a disk named /dev/nvme0n1, you would run the following command to partition,
|
||||||
format and mount the disk.
|
format and mount the disk.
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /tmp/disko-config.nix
|
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /tmp/disko-config.nix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ If you use nix flakes support:
|
|||||||
|
|
||||||
First add it to [niv](https://github.com/nmattia/niv):
|
First add it to [niv](https://github.com/nmattia/niv):
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
niv add nix-community/disko
|
niv add nix-community/disko
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ Then add the following to your configuration.nix in the `imports` list:
|
|||||||
|
|
||||||
As root run:
|
As root run:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
nix-channel --add https://github.com/nix-community/disko/archive/master.tar.gz disko
|
nix-channel --add https://github.com/nix-community/disko/archive/master.tar.gz disko
|
||||||
nix-channel --update
|
nix-channel --update
|
||||||
```
|
```
|
||||||
|
@ -47,7 +47,7 @@ the NixOS manual. Boot the machine from this USB drive.
|
|||||||
|
|
||||||
Identify the name of your system disk by using the `lsblk` command as follows:
|
Identify the name of your system disk by using the `lsblk` command as follows:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
lsblk
|
lsblk
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ from the url you noted above, using the `-o` option to save the file as
|
|||||||
disko-config.nix. Your commands would look like this if you had chosen the
|
disko-config.nix. Your commands would look like this if you had chosen the
|
||||||
hybrid layout:
|
hybrid layout:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
cd /tmp
|
cd /tmp
|
||||||
curl https://raw.githubusercontent.com/nix-community/disko/master/example/hybrid.nix -o /tmp/disko-config.nix
|
curl https://raw.githubusercontent.com/nix-community/disko/master/example/hybrid.nix -o /tmp/disko-config.nix
|
||||||
```
|
```
|
||||||
@ -84,7 +84,7 @@ Inside the disko-config.nix the device needs to point to the correct disk name.
|
|||||||
|
|
||||||
Open the configuration in your favorite editor i.e.:
|
Open the configuration in your favorite editor i.e.:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
nano /tmp/disko-config.nix
|
nano /tmp/disko-config.nix
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -106,14 +106,14 @@ The following step will partition and format your disk, and mount it to `/mnt`.
|
|||||||
|
|
||||||
**Please note: This will erase any existing data on your disk.**
|
**Please note: This will erase any existing data on your disk.**
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /tmp/disko-config.nix
|
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /tmp/disko-config.nix
|
||||||
```
|
```
|
||||||
|
|
||||||
After the command has run, your file system should have been formatted and
|
After the command has run, your file system should have been formatted and
|
||||||
mounted. You can verify this by running the following command:
|
mounted. You can verify this by running the following command:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
mount | grep /mnt
|
mount | grep /mnt
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ command to generate an initial `configuration.nix`. You will be supplying the
|
|||||||
file system configuration details from `disko-config.nix`. Your CLI command to
|
file system configuration details from `disko-config.nix`. Your CLI command to
|
||||||
generate the configuration will be:
|
generate the configuration will be:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
nixos-generate-config --no-filesystems --root /mnt
|
nixos-generate-config --no-filesystems --root /mnt
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ This will create the file `configuration.nix` in `/mnt/etc/nixos`.
|
|||||||
|
|
||||||
b) Move the `disko` configuration to /etc/nixos
|
b) Move the `disko` configuration to /etc/nixos
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
mv /tmp/disko-config.nix /mnt/etc/nixos
|
mv /tmp/disko-config.nix /mnt/etc/nixos
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ take care of that automatically.
|
|||||||
|
|
||||||
f) Finish the installation and reboot your machine,
|
f) Finish the installation and reboot your machine,
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
nixos-install
|
nixos-install
|
||||||
reboot
|
reboot
|
||||||
```
|
```
|
||||||
|
@ -53,13 +53,13 @@ generate disk images:
|
|||||||
|
|
||||||
1. **Build the disko image script:** Replace `mySystem` in the command below with your
|
1. **Build the disko image script:** Replace `mySystem` in the command below with your
|
||||||
specific system configuration name:
|
specific system configuration name:
|
||||||
```bash
|
```console
|
||||||
nix build .#nixosConfigurations.mySystem.config.system.build.diskoImagesScript
|
nix build .#nixosConfigurations.mySystem.config.system.build.diskoImagesScript
|
||||||
```
|
```
|
||||||
2. **Execute the result file:** Execute the generated result file. Running
|
2. **Execute the result file:** Execute the generated result file. Running
|
||||||
`./result --help` will output the available options:
|
`./result --help` will output the available options:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
./result --help
|
./result --help
|
||||||
Usage: $script [options]
|
Usage: $script [options]
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ generate disk images:
|
|||||||
|
|
||||||
- For virtual drive use, define the image size in your Disko configuration:
|
- For virtual drive use, define the image size in your Disko configuration:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
disko.devices.disk.<drive>.imageSize = "32G"; # Set your preferred size
|
disko.devices.disk.<drive>.imageSize = "32G"; # Set your preferred size
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user