about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-07-11 12:54:00 +0200
committerSoispha <soispha@vhack.eu>2023-07-11 12:54:00 +0200
commit81136ec3686d917b714429d58e1df47cb0e6f575 (patch)
treed92f498c578bba9908b67670eba86957fb9a41e6
parentFix(hosts/tiamat): Update to new swapfile uuid (diff)
downloadnixos-config-81136ec3686d917b714429d58e1df47cb0e6f575.tar.gz
nixos-config-81136ec3686d917b714429d58e1df47cb0e6f575.zip
Fix(bootstrap/install): Removed usage of unassigned variable
-rwxr-xr-xbootstrap/01_install4
1 files changed, 2 insertions, 2 deletions
diff --git a/bootstrap/01_install b/bootstrap/01_install
index cf6ac1cb..712587d8 100755
--- a/bootstrap/01_install
+++ b/bootstrap/01_install
@@ -52,7 +52,7 @@ ssd_or_hdd="$(cat /sys/block/"$(basename "$(readlink -f "/dev/disk/by-id/$NIX_DI
 case "$ssd_or_hdd" in
     0)
         msg2 "You seem to use a ssd."
-        trim_support=$(lsblk --bytes --json --discard | jq --arg name "$disk" '.blockdevices | .[] | select(.name == $name) | (.["disc-gran"] + .["disc-max"]) != 0')
+        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"
@@ -61,7 +61,7 @@ case "$ssd_or_hdd" in
                 msg2 "Nay, your ssd doesn't support trim"
                 ;;
             *)
-                warning "Your ssd doesn't seem to exists, if this bothers you please open an issue.'"
+                warning "Your ssd doesn't seem to exists, if this bothers you please open an issue."
                 ;;
         esac
         ;;