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 # 1. install Nix in single user mode
. $HOME/.nix-profile/etc/profile.d/nix.sh . $HOME/.nix-profile/etc/profile.d/nix.sh
mkdir -p ~/.config/nix 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 nix-shell '<home-manager>' -A install
rm ~/.config/nixpkgs/home.nix rm ~/.config/nixpkgs/home.nix
ln -s $HOME/.nixos/flake.nix $HOME/.config/nixpkgs/flake.nix ln -s $HOME/.nixos/flake.nix $HOME/.config/nixpkgs/flake.nix

View File

@ -2,7 +2,7 @@
cd /home/andreas/.nixos 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=( skip=(
"desktop-vm" "desktop-vm"
"gwyn" "gwyn"
@ -18,15 +18,15 @@ reboot=0
while getopts ":r" option; do while getopts ":r" option; do
case $option in case $option in
r) r)
reboot=1 reboot=1
;;
esac esac
done done
for host in "${hosts[@]}" for host in "${hosts[@]}"; do
do
# Check if the host is in the skip list # Check if the host is in the skip list
if [[ " ${skip[*]} " =~ " ${host} " ]];then if [[ " ${skip[*]} " =~ " ${host} " ]]; then
continue continue
fi fi
fqdn="$host.2li.local" fqdn="$host.2li.local"

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e 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=( skip=(
"desktop-vm" "desktop-vm"
"gwyn" "gwyn"
@ -10,10 +10,8 @@ skip=(
"staubfinger" "staubfinger"
) )
for host in "${hosts[@]}"; do
for host in "${hosts[@]}" if [[ " ${skip[*]} " =~ " ${host} " ]]; then
do
if [[ " ${skip[*]} " =~ " ${host} " ]];then
continue continue
fi fi
echo $host echo $host