From 7074302088d7283181f03c8ad3108322b9033bc3 Mon Sep 17 00:00:00 2001 From: Colin Wilk Date: Fri, 3 Jul 2026 18:55:46 +0200 Subject: Add shell.nix for molecule tests --- shell.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..b15061e --- /dev/null +++ b/shell.nix @@ -0,0 +1,44 @@ +{ + pkgs ? import { }, +}: + +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" + ''; +} -- cgit v1.2.3