.files/nix/homeModules/common/gpg.nix
Léana 江 ebf8468807
tree-wide: format with nixfmt
Another saturday another useless formatter change.
It's my dotfiles, after all

alejandra doesn't handle c-style inline comments well.
2025-11-08 10:15:58 +08:00

54 lines
1.3 KiB
Nix

{ pkgs, ... }:
{
services = {
gpg-agent.defaultCacheTtl = 1209600;
gpg-agent.pinentry.package = pkgs.pinentry-tty;
};
programs.gpg.publicKeys =
let
fromUrl =
{
url,
hash,
trust ? 5,
}:
{
source = pkgs.fetchurl { inherit url hash; };
inherit trust;
};
github =
{ user, ... }@args:
fromUrl (builtins.removeAttrs args [ "user" ] // { url = "https://github.com/${user}.gpg"; });
in
map github [
# Do not depend on my own forgejo instance / self-host server to avoid a single point of failure
{
user = "leana8959";
hash = "sha256-Y+v/8bLkyUIe4vjToChQP3ChPxRV/DqI72OTsx6F0oo=";
}
{
user = "vanilla-extracts";
hash = "sha256-6JulBVFmbOHAI7tHiS0Q7L5oQVOXtkUmOLz3+Yz27ec=";
}
{
user = "jappeace";
hash = "sha256-wJ4hiE7M7dcEMaE8waNZEi+tybpVIsFzoeDJhIIaLhk=";
}
{
user = "gautaz";
hash = "sha256-j0I9l8uKfzKNrc2qveFi5mkRppxL36+BUEqvFPs6vqA=";
}
{
user = "confusedkernel";
hash = "sha256-9DdtDAcv+2Z0jJMSLAXbp5ne8uHYj5V/lNGi0kKSdv4=";
}
]
++ map fromUrl [
{
url = "https://eragon.re/pubkey.asc";
hash = "sha256-xvNB+BxqxHqdVBnMhzX3eenN3KmjmdATFPHkPUGweAA=";
}
];
}