about summary refs log tree commit diff
path: root/config/gnupg/module.nix
blob: d134443df70f68a7dc0a08c9aac7597bc8ed7c08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ pkgs, lib, ... }:

let
  inherit (pkgs) callPackage writeText;
  inherit (lib) concatStringsSep mapAttrsToList;

  configs = {
    "gpg.conf" = ./gpg.conf;
    "gpg-agent.conf" = writeText "gpg-agent.conf"
                         (callPackage ./gpg-agent.conf.nix {});
    "dirmngr.conf" = ./dirmngr.conf;
  };

in
  {
    home.qyliss.dirs."state/gnupg".activationScripts.config = ''
      ${concatStringsSep "\n" (mapAttrsToList (name: path: ''
        ln -sf ${path} ${name}
      '') configs)}
    '';

    environment.systemPackages = with pkgs.pkgsConfigured; [ gnupg ];
  }