diff options
author | Soispha <soispha@vhack.eu> | 2024-02-20 17:21:42 +0100 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2024-02-20 17:21:42 +0100 |
commit | f2bdeaed0bcf97a880fe36cfc8a050d1643120b8 (patch) | |
tree | ba4fe9c3ddf076529701c0e776ffef2104ac23d5 /bootstrap/01_install.sh | |
parent | refactor(treewide): Add a `.sh` extension to shell scripts (diff) | |
download | nixos-config-f2bdeaed0bcf97a880fe36cfc8a050d1643120b8.tar.gz nixos-config-f2bdeaed0bcf97a880fe36cfc8a050d1643120b8.zip |
refactor(treewide): Reformat all files with treefmt
This includes getting all shellscripts to pass shellcheck. To accomplish this, some old scripts were removed
Diffstat (limited to 'bootstrap/01_install.sh')
-rwxr-xr-x | bootstrap/01_install.sh | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/bootstrap/01_install.sh b/bootstrap/01_install.sh index e4581b6d..bf49af60 100755 --- a/bootstrap/01_install.sh +++ b/bootstrap/01_install.sh @@ -11,13 +11,14 @@ warning "This information needs to be entered in the host configuration BEFORE r info_applied=false while [ "$info_applied" = false ]; do readp "Have you updated your chosen host with the choose disk id? [N/y]: " result + # shellcheck disable=SC2154 case $result in - [Yy]) - info_applied=true - ;; - *) - warning "You won't be able to boot, if you don't update it!" - ;; + [Yy]) + info_applied=true + ;; + *) + warning "You won't be able to boot, if you don't update it!" + ;; esac done @@ -38,44 +39,44 @@ info_applied=false while [ "$info_applied" = false ]; do readp "Have you updated your chosen host with this information? [N/y]: " result case $result in - [Yy]) - info_applied=true - ;; - *) - warning "You won't be able to boot, if you don't update it!" - ;; + [Yy]) + info_applied=true + ;; + *) + warning "You won't be able to boot, if you don't update it!" + ;; esac done msg "Checking for incompatibilities..." ssd_or_hdd="$(cat /sys/block/"$(basename "$(readlink -f "/dev/disk/by-id/$NIX_DISK")" | tr -d '\n')"/queue/rotational)" case "$ssd_or_hdd" in - 0) - msg2 "You seem to use a ssd." - trim_support=$(lsblk --bytes --json --discard | jq --arg name "$(basename "$(readlink -f "/dev/disk/by-id/$NIX_DISK")" | tr -d '\n')" '.blockdevices | .[] | select(.name == $name) | (.["disc-gran"] + .["disc-max"]) != 0') - case $trim_support in - "true") - msg2 "Yay, your ssd supports trim, go on and activate it" - ;; - "false") - msg2 "Nay, your ssd doesn't support trim" - ;; - *) - warning "Your ssd doesn't seem to exists, if this bothers you please open an issue." - ;; - esac +0) + msg2 "You seem to use a ssd." + trim_support=$(lsblk --bytes --json --discard | jq --arg name "$(basename "$(readlink -f "/dev/disk/by-id/$NIX_DISK")" | tr -d '\n')" '.blockdevices | .[] | select(.name == $name) | (.["disc-gran"] + .["disc-max"]) != 0') + case $trim_support in + "true") + msg2 "Yay, your ssd supports trim, go on and activate it" ;; - 1) - msg2 "You seem to use a hdd there is nothing you have to do" + "false") + msg2 "Nay, your ssd doesn't support trim" ;; *) - warning "There is no indicator, which shows, which drive your are using.\n This means, that you have to check yourself, which optimizations you should activate." + warning "Your ssd doesn't seem to exists, if this bothers you please open an issue." ;; + esac + ;; +1) + msg2 "You seem to use a hdd there is nothing you have to do" + ;; +*) + warning "There is no indicator, which shows, which drive your are using.\n This means, that you have to check yourself, which optimizations you should activate." + ;; esac case "$INSTALL_TO_SETUP" in - "yes") - nix run "git+https://codeberg.org/soispha/nixos-config#setup" --experimental-features 'nix-command flakes' - ;; - *) ;; +"yes") + nix run "git+https://codeberg.org/soispha/nixos-config#setup" --experimental-features 'nix-command flakes' + ;; +*) ;; esac |