pendashteh / magic

Experience magic of docker with a single command
GNU General Public License v3.0
1 stars 0 forks source link

Getting a nix-shell from magic #3

Open pendashteh opened 4 years ago

pendashteh commented 4 years ago

Desired outcome is to be able to run:

$ magic nixos nix-shell -p wget
pendashteh commented 4 years ago

What has worked so far:

docker run -v $(pwd):/root/dev -it --rm nixos/nix sh -c 'echo {} > ./default.nix && nix-shell -p wget'
pendashteh commented 4 years ago

Example of running a PHP built-in server with sqlite enabled:

docker run -v $(pwd):/root/dev -it -p 8083:80 --rm nixos/nix sh -c 'nix-shell -p sqlite -p php73 --run "php -S 0.0.0.0:80 -t /root/dev"'

and open http://localhost:8083