mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-09 05:14:41 -05:00
45 lines
1 KiB
Nix
Executable file
45 lines
1 KiB
Nix
Executable file
{ moduleFunctions }:
|
|
let
|
|
|
|
configPath = ./config;
|
|
printerPath = configPath + /printers;
|
|
|
|
deviceswithFunctions = builtins.listToAttrs (
|
|
map
|
|
(name: {
|
|
name = builtins.substring 0 (builtins.stringLength name - 4) name;
|
|
value = import (configPath + "/${name}") {
|
|
inherit
|
|
moduleFunctions
|
|
;
|
|
};
|
|
})
|
|
(
|
|
builtins.filter (name: builtins.match ".*\\.nix$" name != null) (
|
|
builtins.attrNames (builtins.readDir configPath)
|
|
)
|
|
)
|
|
);
|
|
|
|
devicesPrinters = builtins.listToAttrs (
|
|
map
|
|
(name: {
|
|
name = builtins.substring 0 (builtins.stringLength name - 4) name;
|
|
value = import (printerPath + "/${name}") {
|
|
inherit
|
|
moduleFunctions
|
|
;
|
|
};
|
|
})
|
|
(
|
|
builtins.filter (name: builtins.match ".*\\.nix$" name != null) (
|
|
builtins.attrNames (builtins.readDir printerPath)
|
|
)
|
|
)
|
|
);
|
|
|
|
devices = deviceswithFunctions // devicesPrinters;
|
|
in
|
|
{
|
|
devices = devices;
|
|
}
|