diff --git a/hosts/bluetop/README.adoc b/hosts/bluetop/README.adoc index d33e223..250c709 100644 --- a/hosts/bluetop/README.adoc +++ b/hosts/bluetop/README.adoc @@ -12,10 +12,22 @@ 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 ``, run: + +[,bash] +---- +nix + --extra-experimental-features "flakes nix-command" \ + flake \ + clone \ + --dest \ + github:trueNAHO/os +---- + .Wipe and Format all Disks [%collapsible] ==== @@ -23,59 +35,30 @@ os.hosts.bluetop - NixOS configuration for the bluetop host 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 \ + #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 \ + #format \ + /hosts/bluetop/disko.nix ---- +==== Optionally, update the hardware configuration of the `bluetop` host with: @@ -85,21 +68,21 @@ nixos-generate-config \ --no-filesystems \ --root /mnt \ --show-hardware-config \ - >/mnt/etc/nixos/hosts/bluetop/hardware-configuration.nix + >/hosts/bluetop/hardware_configuration.nix ---- Then, install the `bluetop` host with: [,bash] ---- -nixos-install --flake /mnt/etc/nixos#bluetop +nixos-install --flake #bluetop ---- -Finally, reboot the system with: +Finally, power off the system with: [,bash] ---- -reboot +poweroff ---- == See Also diff --git a/hosts/masterplan/README.adoc b/hosts/masterplan/README.adoc index 421372d..ad2cf3b 100644 --- a/hosts/masterplan/README.adoc +++ b/hosts/masterplan/README.adoc @@ -12,10 +12,22 @@ 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 ``, run: + +[,bash] +---- +nix + --extra-experimental-features "flakes nix-command" \ + flake \ + clone \ + --dest \ + github:trueNAHO/os +---- + .Wipe and Format all Disks [%collapsible] ==== @@ -23,59 +35,30 @@ os.hosts.masterplan - NixOS configuration for the masterplan host 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 \ + #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 \ + #format \ + /hosts/masterplan/disko.nix ---- +==== Optionally, update the hardware configuration of the `masterplan` host with: @@ -85,21 +68,21 @@ nixos-generate-config \ --no-filesystems \ --root /mnt \ --show-hardware-config \ - >/mnt/etc/nixos/hosts/masterplan/hardware-configuration.nix + >/hosts/masterplan/hardware_configuration.nix ---- Then, install the `masterplan` host with: [,bash] ---- -nixos-install --flake /mnt/etc/nixos#masterplan +nixos-install --flake #masterplan ---- -Finally, reboot the system with: +Finally, power off the system with: [,bash] ---- -reboot +poweroff ---- == See Also