motd more conditional

This commit is contained in:
2026-06-14 09:06:59 -05:00
parent f07bbbef01
commit 982d208b13
+4 -3
View File
@@ -6,7 +6,8 @@
}: let }: let
inherit (lib) mkIf mkOption types filterAttrs mapAttrsToList; inherit (lib) mkIf mkOption types filterAttrs mapAttrsToList;
cfg = config.homelab.motd; cfg = config.homelab.motd;
homelab = lib.attrByPath ["homelab"] {} config;
gameservers = lib.attrByPath ["gameservers"] {} config;
# collect services to display # collect services to display
motd_list = motd_list =
mapAttrsToList (_: v: v.motd) mapAttrsToList (_: v: v.motd)
@@ -16,7 +17,7 @@
&& v ? motd && v ? motd
&& v.motd != null && v.motd != null
) )
config.homelab); homelab);
motd_gs_list = lib.concatLists ( motd_gs_list = lib.concatLists (
mapAttrsToList (_: v: v.motd_gs) mapAttrsToList (_: v: v.motd_gs)
@@ -26,7 +27,7 @@
&& v ? motd_gs && v ? motd_gs
&& v.motd_gs != null && v.motd_gs != null
) )
config.gameservers) gameservers)
); );
in { in {
options.homelab.motd = { options.homelab.motd = {