aboutsummaryrefslogtreecommitdiffstats
path: root/shell.nix
diff options
context:
space:
mode:
authorColin Wilk <colin@wilk.cx>2026-06-23 13:22:08 +0200
committerColin Wilk <colin@wilk.cx>2026-06-23 13:22:08 +0200
commit2570550feba2abc80c182ca5e6918f29c22c4cf8 (patch)
treeeff48703966d991f3ae6bc4497a9fb4b18e75c22 /shell.nix
parent0698339964e9289e9347834c91de25eb3ff8f963 (diff)
downloadansible-role-borgbackup-2570550feba2abc80c182ca5e6918f29c22c4cf8.tar.gz
ansible-role-borgbackup-2570550feba2abc80c182ca5e6918f29c22c4cf8.zip
Add shell.nix for molecule testsHEADmaster
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..b07495a
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,40 @@
+{
+ pkgs ? import <nixpkgs> { },
+}:
+
+let
+ python = pkgs.python3.withPackages (ps: [
+ ps.ansible
+ ps.docker
+ ps.molecule
+ ps.molecule-plugins
+ ps.pytest
+ ps.pytest-testinfra
+ ps.requests
+ ]);
+in
+pkgs.mkShell {
+ packages = [
+ python
+ pkgs.docker
+ pkgs.rsync
+ pkgs.python311Packages.requests
+ ];
+
+ shellHook = ''
+ export ANSIBLE_ALLOW_BROKEN_CONDITIONALS=True
+ export PYTHONDONTWRITEBYTECODE=1 # Keep Python from writing .pyc files
+
+
+ echo "=========================================================="
+ echo "🚀 Ansible Molecule Development Environment is ready"
+ echo "=========================================================="
+ echo "Installed Versions:"
+ python --version
+ ansible --version | head -n 1
+ molecule --version | head -n 1
+ echo "=========================================================="
+ echo "Using ANSIBLE_ALLOW_BROKEN_CONDITIONALS=True for molecule-plugins/docker"
+ echo "Run: molecule test -s default"
+ '';
+}