2025-04-12 17:05:38 +02:00
|
|
|
# FIXME(lib.custom): Add some stuff from hmajid2301/dotfiles/lib/module/default.nix, as simplifies option declaration
|
|
|
|
{ lib, ... }:
|
|
|
|
|
|
|
|
{
|
2025-04-12 20:25:10 +02:00
|
|
|
getSecret = with lib.strings; filePath: trim (removeSuffix "\n" (builtins.readFile filePath));
|
|
|
|
|
2025-04-12 17:05:38 +02:00
|
|
|
# use path relative to the root of the project
|
|
|
|
relativeToRoot = lib.path.append ../.;
|
2025-04-12 20:25:10 +02:00
|
|
|
|
2025-04-12 17:05:38 +02:00
|
|
|
scanPaths =
|
|
|
|
path:
|
|
|
|
builtins.map (f: (path + "/${f}")) (
|
|
|
|
builtins.attrNames (
|
|
|
|
lib.attrsets.filterAttrs (
|
|
|
|
path: _type:
|
|
|
|
(_type == "directory") # include directories
|
|
|
|
|| (
|
|
|
|
(path != "default.nix") # ignore default.nix
|
|
|
|
&& (lib.strings.hasSuffix ".nix" path) # include .nix files
|
|
|
|
)
|
|
|
|
) (builtins.readDir path)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|