Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
2.8 kB · 98 lines
Nix
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899{ inputs, ... }:let environment.variables = { GNUPGHOME = "~/.gnupg"; KEYID = "529972E4160200DF"; # pragma: allowlist secret }; home-manager.sharedModules = [ inputs.self.modules.homeManager.gpg ];
flake.modules.nixos.gpg = { inherit environment home-manager; }; flake.modules.darwin.gpg = { inherit environment home-manager; }; flake.modules.homeManager.gpg = { pkgs, ... }: let fetchKey = { key, hash, keyserver ? "keys.openpgp.org", }: let validKeyservers = [ "keys.openpgp.org" ]; url = if keyserver == "keys.openpgp.org" then "https://${keyserver}/vks/v1/by-keyid/${key}" else abort "Invalid keyserver. Must be one of: ${builtins.toString validKeyservers}"; in pkgs.fetchurl { inherit url hash; }; in { programs.gpg = { enable = true;
mutableKeys = true; mutableTrust = false; publicKeys = [ { source = fetchKey { key = "529972E4160200DF"; # pragma: allowlist secret hash = "sha256-Hgr7+Uze9Hlr3cobKwwsrU9OS4luL6LzLVOoZBNrPtw=0"; }; trust = 5; } { # Jonatan source = fetchKey { key = "304CB5F9C479DFFA"; # pragma: allowlist secret hash = "sha256-JyH3kUJiNMAF49RM0H3Zjs75BJfYl0BlF0gsfeeQT+s="; }; trust = 3; } { # William source = pkgs.fetchurl { url = "https://github.com/krabba.gpg"; hash = "sha256-XWXfQ/rI/0eBmUCaA3TtXlwN0K9C+pXF6jfsMRh0yYA="; }; trust = 2; } ];
# https://raw.githubusercontent.com/drduh/config/master/gpg.conf settings = { personal-cipher-preferences = "AES256 AES192 AES"; personal-digest-preferences = "SHA512 SHA384 SHA256"; personal-compress-preferences = "ZLIB BZIP2 ZIP Uncompressed"; default-preference-list = "SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed"; cert-digest-algo = "SHA512"; s2k-digest-algo = "SHA512"; s2k-cipher-algo = "AES256"; charset = "utf-8"; no-comments = true; no-emit-version = true; no-greeting = true; keyid-format = "0xlong"; list-options = "show-uid-validity"; verify-options = "show-uid-validity"; with-fingerprint = true; require-cross-certification = true; no-symkey-cache = true; armor = true; use-agent = true; throw-keyids = true; }; }; };in{ inherit flake;}