From 697f164aa55b1b933300071e1a819a533a2550a0 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 26 Nov 2023 12:14:24 +0100 Subject: [PATCH] Reformat shell scripts --- scripts/install-home-manager.sh | 2 +- scripts/remote_switch.sh | 10 +++++----- scripts/test_build.sh | 8 +++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/scripts/install-home-manager.sh b/scripts/install-home-manager.sh index 9ebc09f..53db6be 100755 --- a/scripts/install-home-manager.sh +++ b/scripts/install-home-manager.sh @@ -2,7 +2,7 @@ # 1. install Nix in single user mode . $HOME/.nix-profile/etc/profile.d/nix.sh mkdir -p ~/.config/nix -echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf +echo "experimental-features = nix-command flakes" >~/.config/nix/nix.conf nix-shell '' -A install rm ~/.config/nixpkgs/home.nix ln -s $HOME/.nixos/flake.nix $HOME/.config/nixpkgs/flake.nix diff --git a/scripts/remote_switch.sh b/scripts/remote_switch.sh index ce46441..6098ea2 100755 --- a/scripts/remote_switch.sh +++ b/scripts/remote_switch.sh @@ -2,7 +2,7 @@ cd /home/andreas/.nixos -hosts=($(echo `nix eval .#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)'` | xargs )) +hosts=($(echo $(nix eval .#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)') | xargs)) skip=( "desktop-vm" "gwyn" @@ -18,15 +18,15 @@ reboot=0 while getopts ":r" option; do case $option in - r) + r) reboot=1 + ;; esac done -for host in "${hosts[@]}" -do +for host in "${hosts[@]}"; do # Check if the host is in the skip list - if [[ " ${skip[*]} " =~ " ${host} " ]];then + if [[ " ${skip[*]} " =~ " ${host} " ]]; then continue fi fqdn="$host.2li.local" diff --git a/scripts/test_build.sh b/scripts/test_build.sh index 4083b22..0a89075 100755 --- a/scripts/test_build.sh +++ b/scripts/test_build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e -hosts=($(echo `nix eval .#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)'` | xargs )) +hosts=($(echo $(nix eval .#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)') | xargs)) skip=( "desktop-vm" "gwyn" @@ -10,10 +10,8 @@ skip=( "staubfinger" ) - -for host in "${hosts[@]}" -do - if [[ " ${skip[*]} " =~ " ${host} " ]];then +for host in "${hosts[@]}"; do + if [[ " ${skip[*]} " =~ " ${host} " ]]; then continue fi echo $host