summaryrefslogtreecommitdiff
path: root/lib/files.nix
blob: 18439d94cdf744911bcd8004f1573c25094222bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{lib, ...}: let

  # gets list of files from a directory
  getFiles = folder:
    lib.attrsets.mapAttrsToList (name: type: "${folder}/${name}") (builtins.readDir folder);

  # gets custom set of root certs
  certs = getFiles ../files/certs;

  # set of ssh keys
  sshKeys = builtins.filter
    (path: lib.strings.hasSuffix "pub" path) (getFiles ../files/keys);

  # set of gpg keys
  gpgKeys = builtins.filter
    (path: lib.strings.hasSuffix "asc" path) (getFiles ../files/keys);

in {
  inherit getFiles;
  inherit certs;
  inherit sshKeys;
  inherit gpgKeys;
}