aboutsummaryrefslogtreecommitdiffstats
path: root/shell.nix
blob: b15061e886f33c59b55eb1c68b9938a80f57481c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
  pkgs ? import <nixpkgs> { },
}:

let
  pythonPackages = ps: [
    ps.ansible-core
    ps.docker
    ps.molecule
    ps.molecule-plugins
    ps.pytest
    ps.pytest-testinfra
  ];
  python = pkgs.python3.withPackages pythonPackages;

in

pkgs.mkShell {
  packages = with pkgs; [
    python
    python311Packages.requests
    docker
    rsync
    zsh
  ];

  shellHook = ''
    export PYTHONDONTWRITEBYTECODE=1
    export ANSIBLE_ALLOW_BROKEN_CONDITIONALS=True
    # TODO: remove ANSIBLE_INJECT_INVOCATION workaround when
    # https://github.com/ansible-community/molecule-plugins/issues/363 is resolved
    export ANSIBLE_INJECT_INVOCATION=true

    echo "============================================"
    echo "*** Ansible Molecule Development Environment"
    echo "============================================"
    echo "Installed Versions:"
    python --version
    ansible --version | head -n 1
    molecule --version | head -n 1
    echo "============================================"
    echo "Run: molecule test -s default"
  '';
}