Skip to content

Commit

Permalink
chore: upgrade flake and use molecule package
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Aug 31, 2023
1 parent bac01dd commit c098a16
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 83 deletions.
35 changes: 9 additions & 26 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 48 additions & 57 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
devshell = {
url = "github:numtide/devshell";
};

moleculepkgs = {
url = "github:dawidd6/nixpkgs/molecule";
};
};

outputs = inputs@{ flake-parts, ... }:
Expand All @@ -34,68 +30,63 @@
];

perSystem = { config, self', inputs', pkgs, system, ... }:
let
molecule-plugins = inputs.moleculepkgs.legacyPackages.${system}.python3Packages.molecule-plugins;
molecule = inputs.moleculepkgs.legacyPackages.${system}.molecule;
let
python310 = pkgs.python310.withPackages (p: with p; [
pytest
pytest-testinfra
molecule
molecule-plugins
]);

python310 = pkgs.python310.withPackages (p: with p; [
pytest
pytest-testinfra
molecule
molecule-plugins
]);

in
{
pre-commit = {
check = {
enable = true;
};
in
{
pre-commit = {
check = {
enable = true;
};

settings = {
hooks = {
later = {
enable = true;
name = "ansible-later";
description = "Run ansible-later on all files in the project";
files = "\\.(yml|yaml)$";
entry = "${pkgs.ansible-later}/bin/ansible-later";
settings = {
hooks = {
later = {
enable = true;
name = "ansible-later";
description = "Run ansible-later on all files in the project";
files = "\\.(yml|yaml)$";
entry = "${pkgs.ansible-later}/bin/ansible-later";
};
};
};
};
};

devshells = {
default = {
commands = [
{
name = "later";
help = "execute later command";
command = "${pkgs.ansible-later}/bin/ansible-later";
}
{
name = "doctor";
help = "execute doctor command";
command = "${pkgs.ansible-doctor}/bin/ansible-doctor -fv";
}
{
name = "testing";
help = "execute molecule command";
command = "${molecule}/bin/molecule test --scenario-name default";
}
];
devshells = {
default = {
commands = [
{
name = "later";
help = "execute later command";
command = "${pkgs.ansible-later}/bin/ansible-later";
}
{
name = "doctor";
help = "execute doctor command";
command = "${pkgs.ansible-doctor}/bin/ansible-doctor -fv";
}
{
name = "testing";
help = "execute molecule command";
command = "${pkgs.molecule}/bin/molecule test --scenario-name default";
}
];

packages = with pkgs; [
ansible
ansible-doctor
ansible-lint
ansible-later
packages = with pkgs; [
ansible-doctor
ansible-lint
ansible-later

molecule
python310
];
python310
];
};
};
};
};
};
}

0 comments on commit c098a16

Please sign in to comment.