Migrate to sops
This commit is contained in:
parent
88332b2401
commit
93cbcd29fb
8 changed files with 130 additions and 45 deletions
22
flake.nix
22
flake.nix
|
@ -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
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue