motd more conditional
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
}: let
|
||||
inherit (lib) mkIf mkOption types filterAttrs mapAttrsToList;
|
||||
cfg = config.homelab.motd;
|
||||
|
||||
homelab = lib.attrByPath ["homelab"] {} config;
|
||||
gameservers = lib.attrByPath ["gameservers"] {} config;
|
||||
# collect services to display
|
||||
motd_list =
|
||||
mapAttrsToList (_: v: v.motd)
|
||||
@@ -16,7 +17,7 @@
|
||||
&& v ? motd
|
||||
&& v.motd != null
|
||||
)
|
||||
config.homelab);
|
||||
homelab);
|
||||
|
||||
motd_gs_list = lib.concatLists (
|
||||
mapAttrsToList (_: v: v.motd_gs)
|
||||
@@ -26,7 +27,7 @@
|
||||
&& v ? motd_gs
|
||||
&& v.motd_gs != null
|
||||
)
|
||||
config.gameservers)
|
||||
gameservers)
|
||||
);
|
||||
in {
|
||||
options.homelab.motd = {
|
||||
|
||||
Reference in New Issue
Block a user