bento: add BENTO_DIR variable to automatically use the right place for bento commands

This commit is contained in:
Solene Rapenne 2022-09-15 18:28:28 +02:00
parent 23ff8f94df
commit 4dfe31b6b1
2 changed files with 11 additions and 0 deletions

View File

@ -79,6 +79,12 @@ Here is the typical directory layout for using **bento** for the non-flakes syst
└── fleet.nix
```
# Environment variables
`bento` is using the following environment variables as configuration:
- `BENTO_DIR`: contains the path of a bento directory, so you can run `bento` commands from anywhere
- `NAME`: contains machine names (flake config or directory in `hosts/`) to restrict commands `deploy` and `build` to this machine only
# Workflow
1. make configuration changes per host in `hosts/` or a global include file in `utils` (you can rename it as you wish)

5
bento
View File

@ -511,6 +511,11 @@ then
usage
fi
if [ -n "${BENTO_DIR}}" ]
then
cd "${BENTO_DIR}"
fi
if [ "$1" = "init" ]
then
IS_BENTO=1