Move Nix files into a nix directory
Move everything from `config` to the root level.
This commit is contained in:
parent
9f47df62b5
commit
69a397e624
124 changed files with 14 additions and 14 deletions
25
nix/lib/shared/scripts/deliver.nix
Normal file
25
nix/lib/shared/scripts/deliver.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ pkgs }:
|
||||
{
|
||||
name = "deliver";
|
||||
|
||||
runtimeInputs = with pkgs; [ docker ];
|
||||
|
||||
text = ''
|
||||
set +o pipefail
|
||||
|
||||
# Based on https://github.com/jessarcher/dotfiles/blob/ef692c35d64db2c13674dfc850a23b6acf9e8f91/scripts/deliver.
|
||||
|
||||
docker_compose_service_name=$(docker compose ps --services 2>/dev/null | grep '^app\|php$' | head -n1)
|
||||
|
||||
if [[ "$docker_compose_service_name" != "" ]]; then
|
||||
if [ -t 1 ]; then
|
||||
"${pkgs.docker}/bin/docker" compose exec "$docker_compose_service_name" "$@"
|
||||
else
|
||||
# The command is not being run in a TTY
|
||||
"${pkgs.docker}/bin/docker" compose exec -T "$docker_compose_service_name" "$@"
|
||||
fi
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue