🚚 [shared] Added shared config that shared desktop config inherits from
This commit is contained in:
@ -1,16 +1,19 @@
|
||||
# FIXME(lib.custom): Add some stuff from hmajid2301/dotfiles/lib/module/default.nix, as simplifies option declaration
|
||||
{ lib, ... }:
|
||||
with builtins;
|
||||
|
||||
{
|
||||
getSecret = with lib.strings; filePath: trim (removeSuffix "\n" (builtins.readFile filePath));
|
||||
getSecret = with lib.strings; filePath: trim (removeSuffix "\n" (readFile filePath));
|
||||
|
||||
# use path relative to the root of the project
|
||||
relativeToRoot = lib.path.append ../.;
|
||||
relativeToBase = lib.path.append ../shared/base;
|
||||
relativeToDesktop = lib.path.append ../shared/desktop;
|
||||
|
||||
scanPaths =
|
||||
path:
|
||||
builtins.map (f: (path + "/${f}")) (
|
||||
builtins.attrNames (
|
||||
map (f: (path + "/${f}")) (
|
||||
attrNames (
|
||||
lib.attrsets.filterAttrs (
|
||||
path: _type:
|
||||
(_type == "directory") # include directories
|
||||
@ -18,7 +21,7 @@
|
||||
(path != "default.nix") # ignore default.nix
|
||||
&& (lib.strings.hasSuffix ".nix" path) # include .nix files
|
||||
)
|
||||
) (builtins.readDir path)
|
||||
) (readDir path)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user