mirror of https://github.com/rapenne-s/bento
bento: add a new option to update flakes recursively
This commit is contained in:
parent
277dadafce
commit
bf98c6f469
21
bento
21
bento
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue