1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2025-03-05 16:36:56 +00:00
flake-parts/examples/shell-environments
2023-06-24 08:22:56 +02:00
..
flake.lock docs: add lock to shell-environments 2023-06-23 19:31:29 +02:00
flake.nix docs: add examples folder 2023-06-22 22:16:05 +02:00
README.md docs: add troubleshooting to shell-environemnts 2023-06-24 08:22:56 +02:00

shell-environment

Warning

If you copy the flake.nix remember to git add [-N|--intent-to-add] flake.nix, otherwise it won't work

This example shows how to create a shell environment which includes a diverse set of tools:

terraform
wget
bat
git

You can search for more package in nix packages

Usage

The devShells option is used by the following command:

nix develop

You can have as many shells as you want, in this flake.nix, you also have another_env which includes curl. To open it:

nix develop .#another_env

Troubleshooting

My shell has changed

There 2 possible solutions:

First, using direnv to manage your dev environments. See direnv-guide. This is the recommended approach.

Second is a simple-unreliable hack, which is adding a shellHook to devShells

devShells.default = pkgs.mkShell {
    shellHook = ''
    exec $SHELL
    '';
};

You might get a lot different issues, use it at your own risk.