This is a group of derivations for nix-shell.
They let you spin up sandboxed installations of tools set for Scala, Haskell, Terraform, etc
without installing anything globally on your computer.
- Install Nix by following their instructions.
- Clone this repo somewhere, say
~/dev/nix-setup - Create a symlink on your system path to the
snscript, say at~/dev/nix-setup/sn
To invoke a set of Nix shells, type sn <shell-name> <shell-name> ... <shell-name>.
Currently supported shell-name values are
| shell-name | Description | Derivation |
|---|---|---|
| aws | AWS CLI | nix-setup/aws.nix |
| haskell | Haskell development | nix-setup/haskell.nix |
| kafka | Kafka tools | nix-setup/kafka.nix |
| scala | Scala development | nix-setup/scala.nix |
| shellutil | Utils for bash or zsh | nix-setup/shell.nix |
| dataflow | Scala development for GCP dataflow (JDK 8 + GCP tools) | nix-setup/dataflow.nix |
| spark | Scala development for Spark (JDK 8) | nix-setup/spark.nix |
| terraform | Terraform tools | nix-setup/terraform.nix |
After loading the specified Nix shells, sn then invokes zsh.
If you don't use zsh, hack the sn script accordingly.
NOTE: The
shellutilshell-name is always added to the specified list.
sn scala aws terraformEntering Nix shell for shellutil
Entering Nix shell for scala
Entering Nix shell for aws
Entering Nix shell for terraform
Entering zsh
-
I haven't tried to make these general. They are what work for me. You can use them as a starting point for your own requirements. Improvement PR's are welcome.
-
Since OS X Mojave 'upgrade', Haskell Stack hasn't worked inside the Nix shell. I haven't resolved this yet. The workaround is to install it (just Stack) globally.
-
Some of the shell-name derivations clash. For instance,
sn scalasets up JDK 11, whereassn sparksets up JDK 8. If you runsn spark scala, expect interesting days.