dotfiles.nix/nixos/common/global/age.nix

32 lines
688 B
Nix
Raw Normal View History

2024-01-21 21:03:57 +08:00
{
2024-08-08 09:02:42 +08:00
config,
pkgs,
inputs,
...
}: let
hostname = config.networking.hostName;
in {
2024-01-21 22:32:25 +08:00
imports = [
inputs.agenix.nixosModules.default
inputs.agenix-rekey.nixosModules.default
];
2024-06-16 23:10:03 +08:00
nixpkgs.overlays = [
inputs.agenix-rekey.overlays.default
];
2024-01-21 21:03:57 +08:00
environment.systemPackages = with pkgs; [
agenix-rekey
];
2024-07-26 14:40:05 +08:00
age.rekey = {
2024-01-21 21:03:57 +08:00
# Pubkey for rekeying
2024-07-26 14:40:05 +08:00
hostPubkey = ../../${hostname}/ssh_host_ed25519_key.pub;
# Master identity used for decryption
2024-08-08 09:02:42 +08:00
masterIdentities = [../users/sajenim/agenix-rekey.pub];
2024-01-21 22:18:12 +08:00
# Where we store the rekeyed secrets
2024-07-26 14:40:05 +08:00
storageMode = "local";
localStorageDir = ./. + "/secrets/rekeyed/${config.networking.hostName}";
2024-01-21 21:03:57 +08:00
};
}