Moved modules and hm dir to hosts dir. Moved some code to shared and extended lib with custom functions

This commit is contained in:
2025-04-12 17:05:38 +02:00
parent df5bea9cc0
commit e3a1dd36d7
99 changed files with 550 additions and 140 deletions

21
lib/default.nix Normal file
View File

@ -0,0 +1,21 @@
# FIXME(lib.custom): Add some stuff from hmajid2301/dotfiles/lib/module/default.nix, as simplifies option declaration
{ lib, ... }:
{
# use path relative to the root of the project
relativeToRoot = lib.path.append ../.;
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)
)
);
}