1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-18 09:19:39 +01:00
nixos/secrets/shell.nix
2023-06-01 14:57:02 +02:00

21 lines
511 B
Nix

{
pkgs ? import <nixpkgs> {},
sops-nix ? pkgs.callPackage <sops-nix> {},
name ? "secrets",
...
}: let
sops-rekey = pkgs.writeShellScriptBin "sops-rekey" ''
${pkgs.findutils}/bin/find . -wholename '*/secrets/*.yaml' -exec ${pkgs.sops}/bin/sops updatekeys {} \;
'';
in
pkgs.mkShell {
sopsPGPKeyDirs = [./keys/users ./keys/hosts];
name = name;
nativeBuildInputs = [
sops-nix.sops-import-keys-hook
sops-nix.ssh-to-pgp
sops-rekey
pkgs.wireguard-tools
];
}