nix/devices: implement disk-prepare

This commit is contained in:
steveej 2018-11-10 19:24:24 +01:00
parent 1f14b36557
commit afd4bb95f9
5 changed files with 136 additions and 83 deletions

View file

@ -73,29 +73,9 @@ hm-iterate-qtile:
wait $!
kill ${XEPHYR_PID}
# Sorry, this is a manual step for now. Please see nix/os/modules/encryptedDisk.nix for the layout
disk-prepare:
echo NOT IMPLEMENTED
# GPT partition table
# part1: size: 1MiB type: 4 BIOS BOOT
# part2: size: 512MiB label: 2-DISKID (36 char limit?)
# part3: size: * label: 3-DISKID (36 char limit?)
# cryptsetup format part3
# vgcreate DISKID part3
# lvcreate DISKID -L 8G -n swap
# lvcreate DISKID -l 100%FREE -n root
# sudo mkfs.vfat -F32 part2
# sudo mkfs.btrfs /dev/DISKID/root
# sudo mkswap /dev/DISKID/swap
# sudo mount /dev/DISKID/root /mnt
# sudo btrfs subvolume create nixos
# sudo btrfs subvolume create home
# sudo mount /dev/disk/by-partlabel/3-DISKID /mnt/DISKID-root
# pushd /dev/disk/by-partlabel/3-DISKID /mnt/DISKID-root
# sudo btrfs subvolume create nixos
# sudo mkdir nixos/{boot,home}
# sudo btrfs subvolume create home
#
# !!! DANGERIOUS !!! This wipes the disk which is configured for the given device.
disk-prepare dir:
just -v _device diskPrepare {{dir}} --argstr rebuildarg "dummy"
# Mount the target disk specified by device configuration directory. The 'dir' argument points to a device configuration, e.g. 'nix/os/devices/steveej-live-mmc-SL32G_0x259093f6'
disk-mount dir:
@ -105,6 +85,6 @@ disk-mount dir:
disk-umount dir:
just -v _device diskUmount {{dir}} --argstr rebuildarg "dummy"
# Perform an offline installation on the mounted the target disk, specified by device configuration directory
# Perform an offline installation on the mounted target disk, specified by device configuration directory
disk-install dir:
just -v _device diskInstall {{dir}} --argstr rebuildarg "dummy"