2022-08-26 19:50:45 +07:00
# Tools container
The tools container makes it easy to get all of the dependencies needed to interact with the homelab.
## How to open it
2022-09-19 02:40:07 +07:00
You can use the default Docker wrapper, or use Nix if you have Nix installed:
2022-08-26 19:50:45 +07:00
=== "Docker"
```sh
make tools
```
=== "Nix"
```sh
2023-10-27 16:37:53 +07:00
nix develop
2022-08-26 19:50:45 +07:00
```
2022-11-06 12:03:48 +07:00
!!! tip
If you have [`direnv` ](https://direnv.net ) installed, you can run `direnv allow` once and it will automatically enter the Nix shell.
2022-08-26 19:50:45 +07:00
It will open a shell like this:
```
2023-10-27 16:37:53 +07:00
[khuedoan@ryzentower:~/Documents/homelab]$ echo hello
2022-08-26 19:50:45 +07:00
hello
```
## How it works
2023-10-27 16:37:53 +07:00
- All dependencies are defined in `./flake.nix`
2022-08-26 19:50:45 +07:00
- When you run `make tools` , it will run a thin Docker wrapper with the `nixos/nix` image (because not everyone has Nix installed) and mount some required volumes
2023-10-27 16:37:53 +07:00
- `nix develop` will start an interactive shell based on the Nix expression in `./flake.nix` and install everything from there
2022-08-26 19:50:45 +07:00
## Known issues
- If your Docker engine is not running in rootless mode, all files created by the tools container will be owned by `root`