{ inputs, outputs, lib, pkgs, config, options, ... }: let # NOTE: synced with dummyPubkey = "age1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs3290gq"; in { # TODO: cleaner deep check config = lib.mkIf (lib.all lib.id [(builtins.hasAttr "age" options) (builtins.hasAttr "rekey" options.age)]) { age.rekey = lib.mkIf (config.age.rekey.hostPubkey != dummyPubkey) { masterIdentities = [ "${inputs.self}/secrets/privkey.age" ]; storageMode = "local"; localStorageDir = "${inputs.self}/secrets/rekeyed/${config.networking.hostName}"; }; }; }