bento: add a new option to update flakes recursively

This commit is contained in:
Solene Rapenne 2022-09-14 21:52:25 +02:00
parent 277dadafce
commit bf98c6f469
1 changed files with 20 additions and 1 deletions

21
bento
View File

@ -3,7 +3,7 @@
# FUNCTION LIBRARIES
usage() {
cat <<EOF
usage: bento init | deploy | build [test|switch] | status [delay]
usage: bento init | deploy | build [test|switch] | status [delay] | flake-update
bento init
: create the layout for bento in the current directory
@ -17,6 +17,9 @@ bento build [test|switch]
bento status [delay]
: display information for remote hosts
bento flake-update
: recursively update flakes lock files
env NAME=someconfig bento deploy|build
: only build / deploy the system "someconfig"
EOF
@ -656,6 +659,22 @@ then
exit 0
fi
# update flakes recursively
if [ "$1" = "flake-update" ]
then
cd hosts || exit 5
find . -type d | while read directory
do
if [ -f "$directory/flake.nix" ]
then
nix flake update path:"$directory"
fi
done
exit 0
fi
# show the status of each host
if [ "$1" = "status" ]
then