fix scripts

This commit is contained in:
chaos 2024-07-24 16:20:58 +01:00
parent 9c524fbf18
commit ee34be27da
No known key found for this signature in database
2 changed files with 2 additions and 12 deletions

View file

@ -15,8 +15,6 @@ if [ -z "${1-}" ]; then
MODE=switch
fi
set -x
if command -v nom &> /dev/null; then
nixos-rebuild --flake "${REPO_ROOT}#$(hostname)" "$MODE" "$@" --keep-failed --log-format internal-json -v |& nom --json
else

View file

@ -4,18 +4,10 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
REPO_ROOT="${SCRIPT_DIR}/.."
cd $REPO_ROOT
MODE=${1-}
if [ -z "${MODE}" ]; then
MODE=switch
else
shift
fi
if command -v nom &> /dev/null; then
if command -v nom &> /dev/null && [ "$MODE" == "switch" ]; then
nix build "${REPO_ROOT}#homeConfigurations.$(hostname)-$(whoami).activationPackage" "$@" --keep-failed --log-format internal-json -v |& nom --json
./activate
else
echo "Install nix-output-monitor for better output"
nix run .#home-manager -- --flake "${REPO_ROOT}#$(hostname)-$(whoami)"
nix run .#home-manager -- --flake "${REPO_ROOT}#$(hostname)-$(whoami)" "$MODE" "$@"
fi