From 01e95de29b9edf1a318eee7aafeeca6f72e6afce Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Fri, 26 Jul 2024 15:37:27 -0700 Subject: [PATCH] nixos: use bulk module import --- modules/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index 9b1db46..43ad7a9 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,14 +1,14 @@ { lib, ... }: +let + dirEntries = builtins.removeAttrs (builtins.readDir ./.) [ "default.nix" ]; + moduleEntries = lib.attrsets.filterAttrs (n: v: v == "regular") dirEntries; + moduleNames = builtins.attrNames moduleEntries; + + modulePaths = builtins.map (name: ./${name}) moduleNames; +in { - imports = [ - ./dwm.nix - ./i18n.nix - ./audio.nix - ./env.nix - ./syncthing.nix - ./plymouth.nix - ]; + imports = modulePaths; snowhawk.i18n.enable = lib.mkDefault true; snowhawk.audio.enable = lib.mkDefault true;