move modules into nixosModules, add autoimport

This commit is contained in:
lassulus
2023-08-01 15:36:33 +02:00
parent bf44bb9b8d
commit 96067a789d
8 changed files with 35 additions and 16 deletions

17
lib/default.nix Normal file
View File

@@ -0,0 +1,17 @@
{ lib, ... }:
let
clanLib = {
findNixFiles = folder:
lib.mapAttrs'
(name: type:
if
type == "directory"
then
lib.nameValuePair name "${folder}/${name}"
else
lib.nameValuePair (lib.removeSuffix ".nix" name) "${folder}/${name}"
)
(builtins.readDir folder);
};
in
clanLib