Replace requirements.txt with a Nix flake
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Paul Brinkmeier 2022-09-20 23:19:18 +02:00
parent 5474dbe720
commit 83dbdcea3e
4 changed files with 72 additions and 4 deletions

View File

@ -2,10 +2,11 @@
## Ansible Control Node Setup
In a Python 3 environment (perhaps a venv), run:
The root of this repo contains a `flake.nix` that defines a shell with all necessary tools.
To drop into a shell with `ansible-*` commands, run:
```
pip install -r requirements.txt
nix develop
```
## `misc.yaml`

View File

@ -1,2 +0,0 @@
ansible==6.4.0
ansible-lint==6.5.2

42
flake.lock generated Normal file
View File

@ -0,0 +1,42 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1663707275,
"narHash": "sha256-xRIlf8OWJLPxeF5y8iToWx9M1P3pUhPuyXeXUrIjaf8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2f8b8bc98da3cbcf287df9cb4fae4857282fe60a",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

27
flake.nix Normal file
View File

@ -0,0 +1,27 @@
{
description = "infrastructure environment";
inputs = {
# lib
nixpkgs.url = github:nixos/nixpkgs;
flake-utils.url = github:numtide/flake-utils;
};
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.python3Packages.ansible
pkgs.python3Packages.ansible-lint
];
shellHook = ''
PS1="(infra) $PS1"
'';
};
}
);
}