refactor rice into config

This commit is contained in:
atagen 2025-07-21 12:26:28 +10:00
parent c33b079159
commit 3095dc27fe
64 changed files with 225 additions and 230 deletions

28
util/recursive-pkgs.nix Normal file
View file

@ -0,0 +1,28 @@
{ lib }:
let
getFiles =
path:
builtins.filter (i: lib.hasSuffix ".nix" (builtins.toString i)) (
lib.filesystem.listFilesRecursive path
);
getPkgsAttrs =
path:
let
prefix = builtins.toString path;
in
map (
file:
let
name = lib.pipe file [
builtins.toString
(lib.removePrefix (prefix + "/"))
(lib.removeSuffix ".nix")
];
in
{
"${name}" = file;
}
) (getFiles path);
getAllPkgs = path: lib.mergeAttrsList (getPkgsAttrs path);
in
getAllPkgs