diff --git a/flake.nix b/flake.nix index e0ce43e..72e7cf4 100644 --- a/flake.nix +++ b/flake.nix @@ -102,7 +102,7 @@ } ); - overlays = local_overlay; + overlays.default = local_overlay; modules = import [ ./modules-all ./modules-linux diff --git a/overlays/default.nix b/overlays/default.nix index ec2ae79..99e7334 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -15,6 +15,16 @@ in rec { datadog-api-client = cp ./datadog-api-client.nix {}; iteration-utilities = cp ./iteration-utilities.nix {}; jinja2-ansible-filters = cp ./jinja2-ansible-filters.nix {}; + molecule = cp ./molecule.nix {}; + molecule-containers = cp ./molecule-containers.nix { + inherit molecule molecule-docker molecule-podman; + }; + molecule-docker = cp ./molecule-docker.nix { + inherit molecule; + }; + molecule-podman = cp ./molecule-podman.nix { + inherit molecule; + }; pydantic = cp ./pydantic.nix {}; pyyaml-include = cp ./pyyaml-include.nix {}; xonsh-direnv = cp ./xonsh-direnv.nix {}; diff --git a/overlays/molecule-containers.nix b/overlays/molecule-containers.nix new file mode 100644 index 0000000..e217ed2 --- /dev/null +++ b/overlays/molecule-containers.nix @@ -0,0 +1,46 @@ +{ lib, buildPythonPackage, fetchPypi, pkgs, +setuptools, setuptools-scm, setuptools-scm-git-archive, wheel, +molecule, +molecule-docker, +molecule-podman, +}: + +let + pydeps = [ + molecule + molecule-docker + molecule-podman + ]; +in buildPythonPackage rec { + pname = "molecule-containers"; + version = "2.0.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-yD90kAFyhhT5cnhIdVhamaR8vIT7jjfwUkRmDqfUx5w="; + }; + + meta = with lib; { + description = "A pluin for Molecule to run in Podman/Docker containers"; + homepage = "https://github.com/ansible-community/molecule-containers"; + license = licenses.mit; + maintainers = []; + }; + + doCheck = false; + + # Gets pulled into running environments as well + propagatedBuildInputs = pydeps; + + format = "pyproject"; + # Only needed at the buid stage + buildInputs = [ + setuptools + #setuptools-scm + #setuptools-scm-git-archive + #wheel + ]; + + nativeBuildInputs = with pkgs; [ + ]; +} diff --git a/overlays/molecule-docker.nix b/overlays/molecule-docker.nix new file mode 100644 index 0000000..52d4d27 --- /dev/null +++ b/overlays/molecule-docker.nix @@ -0,0 +1,46 @@ +{ lib, buildPythonPackage, fetchPypi, pkgs, +setuptools, setuptools-scm, setuptools-scm-git-archive, wheel, +docker, +molecule, +selinux-python, +}: + +let + pydeps = [ + docker + molecule + selinux-python + ]; +in buildPythonPackage rec { + pname = "molecule-docker"; + version = "2.1.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-GVuXZzy8IzXPpoEIFt5cv4B1B781Cp0WypiyJLFkcUU="; + }; + + meta = with lib; { + description = "A plugin for Molecule providing Docker resources"; + homepage = "https://github.com/ansible-community/molecule-docker"; + license = licenses.mit; + maintainers = []; + }; + + doCheck = false; + + # Gets pulled into running environments as well + propagatedBuildInputs = pydeps; + + format = "pyproject"; # For when it has only pyproject.toml + # Only needed at the buid stage + buildInputs = [ + setuptools + setuptools-scm + setuptools-scm-git-archive + wheel + ]; + + nativeBuildInputs = with pkgs; [ + ]; +} diff --git a/overlays/molecule-podman.nix b/overlays/molecule-podman.nix new file mode 100644 index 0000000..2683b06 --- /dev/null +++ b/overlays/molecule-podman.nix @@ -0,0 +1,44 @@ +{ lib, buildPythonPackage, fetchPypi, pkgs, +setuptools, setuptools-scm, setuptools-scm-git-archive, wheel, +molecule, +selinux-python, +}: + +let + pydeps = [ + molecule + selinux-python + ]; +in buildPythonPackage rec { + pname = "molecule-podman"; + version = "2.0.3"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-zqLqysVPEpgkUw01Rp3de/8QmpTrzYQIgor4wNq/XHo="; + }; + + meta = with lib; { + description = "A plugin for Molecule allowing Podman resources"; + homepage = "https://github.com/ansible-community/molecule-podman"; + license = licenses.mit; + maintainers = []; + }; + + doCheck = false; + + # Gets pulled into running environments as well + propagatedBuildInputs = pydeps; + + format = "pyproject"; # For when it has only pyproject.toml + # Only needed at the buid stage + buildInputs = [ + setuptools + setuptools-scm + setuptools-scm-git-archive + wheel + ]; + + nativeBuildInputs = with pkgs; [ + ]; +} diff --git a/overlays/molecule.nix b/overlays/molecule.nix new file mode 100644 index 0000000..6c5a3ff --- /dev/null +++ b/overlays/molecule.nix @@ -0,0 +1,56 @@ +{ lib, buildPythonPackage, fetchPypi, pkgs, +setuptools, setuptools-scm, setuptools-scm-git-archive, wheel, +ansible-compat, +click-help-colors, +cookiecutter, +enrich, +jsonschema, +packaging, +pluggy, +pyyaml, +}: + +let + pydeps = [ + ansible-compat + click-help-colors + cookiecutter + enrich + jsonschema + packaging + pluggy + pyyaml + ]; +in buildPythonPackage rec { + pname = "molecule"; + version = "4.0.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-EzYvdBocgCeaKyX0mh9Vw7/DRQVMX+7c3N+SjhED4eU="; + }; + + meta = with lib; { + description = "A test framework for Ansible."; + homepage = "https://github.com/ansible-community/molecule"; + license = licenses.mit; + maintainers = []; + }; + + doCheck = false; + + # Gets pulled into running environments as well + propagatedBuildInputs = pydeps; + + format = "pyproject"; + # Only needed at the buid stage + buildInputs = [ + setuptools + setuptools-scm + setuptools-scm-git-archive + wheel + ]; + + nativeBuildInputs = with pkgs; [ + ]; +} diff --git a/overlays/packages.nix b/overlays/packages.nix index c094ce7..c8d435c 100644 --- a/overlays/packages.nix +++ b/overlays/packages.nix @@ -4,6 +4,7 @@ let callPackage = pkgs.lib.callPackageWith pkgs; lib = pkgs.lib; python = pkgs.packages.python3; + cp = pkgs.packages.python3.pkgs.callPackage; in { datadog-api-client = callPackage ./datadog-api-client.nix { inherit pkgs lib;