about summary refs log tree commit diff stats
path: root/bootstrap/activate/activate.sh
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-07-01 18:45:39 +0200
committerSoispha <soispha@vhack.eu>2023-07-10 16:44:12 +0200
commitc3d2c88eed96b82fa8e83e8b6ee53c414a0e4431 (patch)
treea5a9553ba5cbf5b6095ae575ecca27356b73c96d /bootstrap/activate/activate.sh
parentFeat(system/disks): Add luks partition (diff)
downloadnixos-config-c3d2c88eed96b82fa8e83e8b6ee53c414a0e4431.tar.gz
nixos-config-c3d2c88eed96b82fa8e83e8b6ee53c414a0e4431.zip
Refactor(bootstrap): Use disko
Diffstat (limited to '')
-rwxr-xr-xbootstrap/activate/activate.sh75
1 files changed, 0 insertions, 75 deletions
diff --git a/bootstrap/activate/activate.sh b/bootstrap/activate/activate.sh
deleted file mode 100755
index 0c3589c5..00000000
--- a/bootstrap/activate/activate.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#! /usr/bin/env dash
-
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH
-
-mne() {
-    mount --mkdir --options compress-force=zstd:15,subvol="$1" "$DISK_ROOT" "$2" || dien "Mounting of $1";
-}
-
-
-available_disks="$(mktmp)";
-lsblk -J | jq '.[] | map(.name) | [foreach .[] as $item ({item: null, index: -1}; {$item, index: (.index + 1)})]' > "$available_disks";
-
-
-[ "$(jq '.[]' "$available_disks" | wc -l)" -eq 0 ] && die "No disks found"
-msg "Select where your system is installed:\n"
-
-i=9999; # nobody will have so many disks attached
-
-while ! jq -e --argjson i "$i" '.[$i]' "$available_disks" > /dev/null 2>&1; do
-    for disk in $(jq -c '.[]' "$available_disks" ); do
-        printf "%4s) %s \n" "$(echo "$disk" | jq '.index')" "$(echo "$disk" | jq '.item' | tr -d "\"")";
-    done
-    printf "%4s) Exit\n" "q"
-    readp  "Enter a option: " disk
-
-    if [ $disk = "q" ];then
-        exit 1
-    else
-        i="$disk"
-    fi
-    if jq -e --argjson i "$i" 'nth($i)' "$available_disks"  > /dev/null 2>&1; then
-        disk="$(jq -e --argjson i "$i" 'nth($i) | .item' "$available_disks" | tr -d "\"")";
-    else
-        warning "No disk selected. Select a disk to continue.\n"
-    fi
-done
-
-case "$disk" in
-    "nvme"*)
-        export DISK_EFI="/dev/${disk}"p1
-        export DISK_ROOT="/dev/${disk}"p2
-        ;;
-    "sd"* |"vd"*)
-        export DISK_EFI="/dev/${disk}"1
-        export DISK_ROOT="/dev/${disk}"2
-        ;;
-    *)
-        die "The disk type: ${disk} is not yet supported!"
-        ;;
-esac
-
-msg "Mounting..."
-# TODO umount -R /mnt
-mount -t tmpfs none /mnt
-mount --mkdir "$DISK_EFI" /mnt/boot
-
-mne nix-store /mnt/nix
-mne persistent-storage /mnt/srv
-
-mount --mkdir --options bind /mnt/srv/nixos-config /mnt/etc/nixos
-
-msg "Finished mounting"
-readp "Do you want to continue with nixos-install? [N/y]: " result
-case $result in
-    [Yy])
-        nix run "git+https://codeberg.org/soispha/nixos-config#setup" --experimental-features 'nix-command flakes';
-        ;;
-    *)
-        msg "Sure, do it yourself"
-        exit 1
-        ;;
-esac
-
-# vim: ft=sh