Skip to content

Commit

Permalink
docs(hosts): update installation process
Browse files Browse the repository at this point in the history
  • Loading branch information
trueNAHO committed Feb 18, 2024
1 parent ab0e62c commit c9d911e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 90 deletions.
73 changes: 28 additions & 45 deletions hosts/bluetop/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,70 +12,53 @@ os.hosts.bluetop - NixOS configuration for the bluetop host

== Description

{nixos}[NixOS] configuration for the `bluetop` host
{nixos}[NixOS] configuration for the `bluetop` host.

== Usage

To clone the latest flake of the `bluetop` host to `<REPOSITORY>`, run:

[,bash]
----
nix
--extra-experimental-features "flakes nix-command" \
flake \
clone \
--dest <REPOSITORY> \
github:trueNAHO/os
----

.Wipe and Format all Disks
[%collapsible]
====
[IMPORTANT]
The following operations wipe and format all disks, leading to irreversible data
loss.
The following two code snippets wipe and format all disks for the `bluetop` host
with {erase-your-darlings}[impermanent] {disko-config-nix}[FAT32 boot, encrypted
Btrfs root, and swap partitions].
To {data-at-rest-encryption-preparing-the-disk}[prepare the disk by overwriting
it with a stream of random bytes], {securely-wipe-disk-shred}[shred it] by
running:
[,bash]
----
shred --random-source=/dev/urandom --verbose /dev/nvme0n1
----
Then, encrypt and format all disks for the `bluetop` host by running:
[,bash]
----
(
set -e
trap 'rm --force "$disko" "$password_file"' EXIT
disko="$(mktemp)"
curl \
--output "$disko" \
https://raw.githubusercontent.com/trueNAHO/os/master/hosts/bluetop/disko.nix
password_file="$(mktemp)"
read -p 'Disk encryption password: ' -rs password
printf '%s' "$password" >"$password_file"
nix run \
--extra-experimental-features "flakes nix-command" \
github:nix-community/disko \
-- \
--arg passwordFile "\"$password_file\"" \
--mode disko \
"$disko"
)
nix \
--extra-experimental-features "flakes nix-command" \
run \
<REPOSITORY>#shred \
/dev/nvme0n1
----
====
To clone the latest flake of the `bluetop` host to `/mnt/etc/nixos`, run:
Then, format all disks by running:
[,bash]
----
nix flake clone \
--dest /mnt/etc/nixos \
nix \
--extra-experimental-features "flakes nix-command" \
github:trueNAHO/os
run \
<REPOSITORY>#format \
<REPOSITORY>/hosts/bluetop/disko.nix
----
====

Optionally, update the hardware configuration of the `bluetop` host with:

Expand All @@ -85,21 +68,21 @@ nixos-generate-config \
--no-filesystems \
--root /mnt \
--show-hardware-config \
>/mnt/etc/nixos/hosts/bluetop/hardware-configuration.nix
><REPOSITORY>/hosts/bluetop/hardware_configuration.nix
----

Then, install the `bluetop` host with:

[,bash]
----
nixos-install --flake /mnt/etc/nixos#bluetop
nixos-install --flake <REPOSITORY>#bluetop
----

Finally, reboot the system with:
Finally, power off the system with:

[,bash]
----
reboot
poweroff
----

== See Also
Expand Down
73 changes: 28 additions & 45 deletions hosts/masterplan/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,70 +12,53 @@ os.hosts.masterplan - NixOS configuration for the masterplan host

== Description

{nixos}[NixOS] configuration for the `masterplan` host
{nixos}[NixOS] configuration for the `masterplan` host.

== Usage

To clone the latest flake of the `masterplan` host to `<REPOSITORY>`, run:

[,bash]
----
nix
--extra-experimental-features "flakes nix-command" \
flake \
clone \
--dest <REPOSITORY> \
github:trueNAHO/os
----

.Wipe and Format all Disks
[%collapsible]
====
[IMPORTANT]
The following operations wipe and format all disks, leading to irreversible data
loss.
The following two code snippets wipe and format all disks for the `masterplan`
host with {erase-your-darlings}[impermanent] {disko-config-nix}[FAT32 boot,
encrypted Btrfs root, and swap partitions].
To {data-at-rest-encryption-preparing-the-disk}[prepare the disk by overwriting
it with a stream of random bytes], {securely-wipe-disk-shred}[shred it] by
running:
[,bash]
----
shred --random-source=/dev/urandom --verbose /dev/nvme0n1
----
Then, encrypt and format all disks for the `masterplan` host by running:
[,bash]
----
(
set -e
trap 'rm --force "$disko" "$password_file"' EXIT
disko="$(mktemp)"
curl \
--output "$disko" \
https://raw.githubusercontent.com/trueNAHO/os/master/hosts/masterplan/disko.nix
password_file="$(mktemp)"
read -p 'Disk encryption password: ' -rs password
printf '%s' "$password" >"$password_file"
nix run \
--extra-experimental-features "flakes nix-command" \
github:nix-community/disko \
-- \
--arg passwordFile "\"$password_file\"" \
--mode disko \
"$disko"
)
nix \
--extra-experimental-features "flakes nix-command" \
run \
<REPOSITORY>#shred \
/dev/nvme0n1
----
====
To clone the latest flake of the `masterplan` host to `/mnt/etc/nixos`, run:
Then, format all disks by running:
[,bash]
----
nix flake clone \
--dest /mnt/etc/nixos \
nix \
--extra-experimental-features "flakes nix-command" \
github:trueNAHO/os
run \
<REPOSITORY>#format \
<REPOSITORY>/hosts/masterplan/disko.nix
----
====

Optionally, update the hardware configuration of the `masterplan` host with:

Expand All @@ -85,21 +68,21 @@ nixos-generate-config \
--no-filesystems \
--root /mnt \
--show-hardware-config \
>/mnt/etc/nixos/hosts/masterplan/hardware-configuration.nix
><REPOSITORY>/hosts/masterplan/hardware_configuration.nix
----

Then, install the `masterplan` host with:

[,bash]
----
nixos-install --flake /mnt/etc/nixos#masterplan
nixos-install --flake <REPOSITORY>#masterplan
----

Finally, reboot the system with:
Finally, power off the system with:

[,bash]
----
reboot
poweroff
----

== See Also
Expand Down

0 comments on commit c9d911e

Please sign in to comment.