rewrite find module

This commit is contained in:
Daylin Morgan 2025-01-27 14:20:14 -06:00
parent dff345b9f0
commit b38b20a81b
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 21 additions and 27 deletions

View file

@ -27,7 +27,6 @@ runs:
BTRFS: ${{ inputs.btrfs }} BTRFS: ${{ inputs.btrfs }}
run: exec ${{ github.action_path }}/prepare.sh run: exec ${{ github.action_path }}/prepare.sh
- uses: daylinmorgan/lix-gha-installer-action@released - uses: daylinmorgan/lix-gha-installer-action@released
with: with:
extra-conf: ${{ inputs.nix_conf }} extra-conf: ${{ inputs.nix_conf }}

View file

@ -10,13 +10,9 @@ let
; ;
in in
rec { rec {
# https://github.com/balsoft/nixos-config/blob/73cc2c3a8bb62a9c3980a16ae70b2e97af6e1abd/flake.nix#L109-L120
findModulesList = handleModule =
dir: dir: name: type:
concatLists (
attrValues (
mapAttrs (
name: type:
if type == "regular" then if type == "regular" then
[ [
{ {
@ -32,8 +28,7 @@ rec {
} }
] ]
else else
findModulesList (dir + "/${name}") findModulesList (dir + "/${name}");
) (readDir dir)
) findModulesList = dir: (readDir dir) |> mapAttrs (handleModule dir) |> attrValues |> concatLists;
);
} }