Dev environments

Create a shell.nix with the following:

shell.nix
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
pkgs = import nixpkgs { };
in
pkgs.mkShell {
packages = [ pkgs.python3 ];
shellHook = ''
echo "Welcome in my nix shell"
'';
}

run

Terminal window
nix-shell

This activates your shell.nix and you should see:

Terminal window
unpacking 'https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz' into the Git cache...
Welcome in your nix shell

python3 is available

Terminal window
$ python3 --version

To leave the shell

Terminal window
ctrl+D

For further information check out nix-shell