From 430c840687ba3fcadc9ac5ab3aa0b270db716a8e Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Sun, 7 Jan 2024 16:59:43 +0100 Subject: [PATCH] chore(just): add missing quick options for setup-nix --- build/ublue-os-just/70-nix.just | 52 +++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/build/ublue-os-just/70-nix.just b/build/ublue-os-just/70-nix.just index 1faacb78..161e1401 100644 --- a/build/ublue-os-just/70-nix.just +++ b/build/ublue-os-just/70-nix.just @@ -1,7 +1,7 @@ # vim: set ft=make : # Install, uninstall or configure nix -setup-nix: +setup-nix ARG="prompt": #!/usr/bin/env bash CURRENT_STATE="Not Installed" if [ -f "/etc/systemd/system/nix-daemon.socket" ]; then @@ -9,38 +9,52 @@ setup-nix: fi bold=$(tput bold) normal=$(tput sgr0) - echo "Nix is currently: ${bold}${CURRENT_STATE}${normal}" - echo 'What would you like to do with Nix?' - OPTION=$(ugum choose \ - Install \ - Uninstall \ - "Update nix user profile" \ - "Update all nix profiles" \ - "Re-copy nix systemd units to system" \ - "Add nix path to sudo" \ - "Remove nix path from sudo" \ - ) - if [ "$OPTION" == "Install" ]; then + OPTION={{ ARG }} + if [ "$OPTION" == "prompt" ]; then + echo "Nix is currently: ${bold}${CURRENT_STATE}${normal}" + echo 'What would you like to do with Nix?' + OPTION=$(ugum choose \ + Install \ + Uninstall \ + "Update nix user profile" \ + "Update all nix profiles" \ + "Re-copy nix systemd units to system" \ + "Add nix path to sudo" \ + "Remove nix path from sudo" \ + ) + elif [ "$OPTION" == "help" ]; then + echo "Usage: ujust setup-nix