Migrate to sops

This commit is contained in:
Florian RICHER 2024-07-14 20:35:22 +02:00
parent 88332b2401
commit 93cbcd29fb
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
8 changed files with 130 additions and 45 deletions

View file

@ -10,6 +10,26 @@
flake-utils.lib.eachSystem flake-utils.lib.allSystems (system:
let
pkgs = import nixpkgs { inherit system; };
init_sops = pkgs.writeScriptBin "init_sops" ''
#!${pkgs.runtimeShell}
echo "Decrypting vars file"
sops -d group_vars/all.enc.yml > group_vars/all.yml
echo "Decrypt inventory file"
sops -d work/inventory.enc.yml > work/inventory.yml
'';
clean_sops = pkgs.writeScriptBin "clean_sops" ''
#!${pkgs.runtimeShell}
echo "Decrypting vars file"
sops -d group_vars/all.enc.yml > group_vars/all.yml
echo "Decrypt inventory file"
sops -d work/inventory.enc.yml > work/inventory.yml
'';
in
{
devShells = {
@ -17,6 +37,8 @@
buildInputs = [
pkgs.ansible
pkgs.sops
init_sops
clean_sops
];
};
};