infrastructure/lib/default.nix

23 lines
582 B
Nix
Raw Normal View History

2023-05-22 15:05:20 +02:00
{ lib, ... }:
let
trivial = import ./trivial.nix;
in
trivial // (with trivial; rec {
mkImport = root: file:
let path = mkRel root file; in
path + (lib.optionalString (!lib.pathIsDirectory path) ".nix");
mkImports = root: builtins.map (mkImport root);
2023-05-22 15:36:53 +02:00
getKeys = name: builtins.filter
(k: k != "")
(lib.splitString "\n" (builtins.readFile (mkRel ../keys "${name}.keys")));
2023-05-22 15:05:20 +02:00
/* List version of getKeys */
getAllKeys = names: builtins.concatLists (builtins.map getKeys names);
getKeyFiles = builtins.map (compose (n: "${n}.keys") (mkRel ../keys));
})