diff --git a/scripts/Common/Scripts/config.fish b/scripts/Common/Scripts/config.fish index b3e39653..41dfdd8e 100755 --- a/scripts/Common/Scripts/config.fish +++ b/scripts/Common/Scripts/config.fish @@ -3,6 +3,25 @@ function isConfigured -S set -q CONFIG_NAME end +function selectProfile -S -a result + source "$(status dirname)/../../../lib/modules/partition/select.fish" + set -l file (mktemp) + set -l header "NAME" + set -l profiles + + getProfiles | jq ".[]" --raw-output0 | string split0 | while read profile + set -a profiles "$profile" + end + + select "$header" "$file" \ + "Please choose a profile" \ + "No profiles specified" \ + "$(string collect $profiles)" + + set -g "$result" (cat "$file") + rm "$file" +end + function getProfiles -S source "$(status dirname)/eval-flake.fish"; evalFlake "" "" --apply "builtins.attrNames" --json