motd more conditional
This commit is contained in:
@@ -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 = {
|
||||||
|
|||||||
Reference in New Issue
Block a user