diff options
author | Freya Murphy <freya@freyacat.org> | 2025-06-24 11:51:39 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-06-24 11:51:39 -0400 |
commit | d639c293ad1ba71008aeb5c54c40f59a076018dc (patch) | |
tree | e832a3f0ee5044c8b35e5642f07a62137bbffc2c /lib/files.nix | |
parent | update ssh config (diff) | |
download | dotfiles-nix-d639c293ad1ba71008aeb5c54c40f59a076018dc.tar.gz dotfiles-nix-d639c293ad1ba71008aeb5c54c40f59a076018dc.tar.bz2 dotfiles-nix-d639c293ad1ba71008aeb5c54c40f59a076018dc.zip |
redo lib, make global vars for key lists
Diffstat (limited to '')
-rw-r--r-- | lib/files.nix | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/files.nix b/lib/files.nix new file mode 100644 index 0000000..18439d9 --- /dev/null +++ b/lib/files.nix @@ -0,0 +1,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; +} |