summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2025-08-06 13:56:34 -0600
committerAlejandro Soto <alejandro@34project.org>2025-08-06 13:56:54 -0600
commit31711962b9ae7985287b98a165a52c40da402f4b (patch)
tree39f8ede7d4430033d503e9236009f16523c5cf61
parent3e85a281ec997ddfac4601c15e6851e6dd31bfb6 (diff)
modules: automatically import all modules
-rw-r--r--doctrine/lib/importAll.nix4
-rw-r--r--modules/default.nix6
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 = ./.;});
}