nix-config/nixos/_mixins/sops.nix

16 lines
286 B
Nix
Raw Permalink Normal View History

{ inputs, config, ... }:
let
isEd25519 = k: k.type == "ed25519";
getKeyPath = k: k.path;
keys = builtins.filter isEd25519 config.services.openssh.hostKeys;
in
{
imports = [
inputs.sops-nix.nixosModules.sops
];
sops = {
age.sshKeyPaths = map getKeyPath keys;
};
}