From 5d375d1d930631b960393b8de12eae16abbe01e0 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Wed, 6 Aug 2025 13:56:34 -0600 Subject: [PATCH] modules: automatically import all modules --- doctrine/lib/importAll.nix | 4 ++-- modules/default.nix | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doctrine/lib/importAll.nix b/doctrine/lib/importAll.nix index 6acabe9..03c5330 100644 --- a/doctrine/lib/importAll.nix +++ b/doctrine/lib/importAll.nix @@ -1,6 +1,6 @@ {lib}: { root, - exclude ? [], + exclude ? ["default"], }: with builtins; with lib; @@ -10,7 +10,7 @@ with lib; isMatch = name: type: (hasSuffix ".nix" name || type == "directory") - && ! elem name (map basename exclude); + && ! elem (basename name) exclude; entry = name: _: { name = basename name; diff --git a/modules/default.nix b/modules/default.nix index bd5d292..0c0fd4c 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,5 +1,3 @@ -{ - imports = [ - ./sway - ]; +{doctrine, ...}: { + imports = builtins.attrValues (doctrine.lib.importAll {root = ./.;}); }