Reformat shell scripts

This commit is contained in:
Andreas Zweili 2023-11-26 12:14:24 +01:00
parent 3d32f750f0
commit 697f164aa5
3 changed files with 9 additions and 11 deletions

View File

@ -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 '<home-manager>' -A install
rm ~/.config/nixpkgs/home.nix
ln -s $HOME/.nixos/flake.nix $HOME/.config/nixpkgs/flake.nix

View File

@ -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"

View File

@ -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