1
0
Fork 0
myserver-configuration/flake.nix
2024-07-14 20:35:22 +02:00

46 lines
1.2 KiB
Nix

{
description = "Portfolio rust configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
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 = {
default = pkgs.mkShell {
buildInputs = [
pkgs.ansible
pkgs.sops
init_sops
clean_sops
];
};
};
});
}