Created
December 24, 2021 21:47
-
-
Save kauhat/f66a1e6569212e5fcd159040bd117b12 to your computer and use it in GitHub Desktop.
Laravel Nix workspace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> { } }: | |
let | |
# Provide a script to start the Docker service. | |
daemonServiceScript = | |
pkgs.writeScript "check-daemon-service" '' | |
#!${pkgs.runtimeShell} | |
echo "Checking Docker service..." | |
if service docker status 2>&1 | grep -q "is not running"; then | |
echo "Service not running." | |
echo "Starting Docker..." | |
wsl.exe -d "''${WSL_DISTRO_NAME}" -u root -e /usr/sbin/service docker start >/dev/null 2>&1 | |
fi | |
''; | |
in | |
pkgs.mkShell { | |
buildInputs = [ | |
pkgs.php80 | |
pkgs.docker-compose | |
pkgs.php80Packages.composer | |
pkgs.php80Packages.php-cs-fixer | |
pkgs.php80Packages.phpstan | |
]; | |
shellHook = '' | |
${daemonServiceScript} | |
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail' | |
# alias artisan="./vendor/bin/sail artisan" | |
# alias composer="./vendor/bin/sail composer" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment