Explore the world of devenv.sh, built with the best technologies of the 90s and the power of modern web development!
Best viewed with or
This section is , but here are some hints:
Topic | Status |
---|---|
Files and variables | Ready! |
Ad-hoc environments | Ready! |
Writing devenv.nix | Ready! |
Writing devenv.yaml | ![]() |
Scripts are your friends!
devenv.nix {pkgs,...}:{ packages=[pkgs.curl pkgs.jq]; scripts.silly-example.exec='curl "https://httpbin.org/get?$1" | jq '.args''; }
Here's an example that shows how to define an alias & forward arguments:
scripts.foo.exec = ''npx @foo/cli "$@";'';
Sometimes we don't want to expose the tools to the shell but still make sure they are pinned in a script:
devenv.nix {pkgs,...}:{ scripts.silly-example.exec='${pkgs.curl}/bin/curl "https://httpbin.org/get?$1" |${pkgs.jq}/bin/jq '.args''; }
Scripts can also execute using a package and have a description, which can be useful in yourenterShell.
devenv.nix {pkgs,config,lib,...}:{ scripts.python-hello={exec='print("Hello, world!")';package=config.languages.python.package;description="hello world in Python";}; scripts.nushell-greet={exec='def greet [name] {["hello" $name]}greet "world"'';package=pkgs.nushell;binary="nu";description="Greet in Nu Shell";}; enterShell='echoecho 🦾 Helper scripts you can run to make your development richer:echo 🦾${pkgs.gnused}/bin/sed -e 's| |••|g' -e 's|=| |' <![]()