diff --git a/modules/hosts/soteria/soteria.nix b/modules/hosts/soteria/soteria.nix index 4ff3299..fc36f8c 100644 --- a/modules/hosts/soteria/soteria.nix +++ b/modules/hosts/soteria/soteria.nix @@ -55,6 +55,13 @@ in port = 443; }; + loginText.extraServiceStatus = { + Docker = "docker"; + "mTLS Renewal" = "mtls-renew.timer"; + Forgejo = "forgejo.service"; + "Forgejo Backup" = "forgejo-dump.timer"; + }; + step-ssh-host.hostname = hostname; # This provides the secrets at install time diff --git a/modules/nixos/login-text.nix b/modules/nixos/login-text.nix index 9d0626b..8ead9dd 100644 --- a/modules/nixos/login-text.nix +++ b/modules/nixos/login-text.nix @@ -1,44 +1,56 @@ { inputs, ... }: { - flake.modules.nixos.login-text = { config, ... }: { - programs.rust-motd = { - enable = true; - refreshInterval = "*:0/5"; - order = [ - "global" - "last_login" - "service_status" - # "uptime" - "memory" - "filesystems" - ]; - settings = { - global = { - time_format = "%Y-%m-%d %H:%M:%S %Z"; - }; + flake.modules.nixos.login-text = { config, lib, ... }: + let + defaultServiceStatus = { + SSH = "sshd.socket"; + "SSH Cert Renewal" = "step-ssh-host-renew.timer"; + }; + in { + options.loginText.extraServiceStatus = lib.mkOption { + type = lib.types.attrsOf lib.types.str; + default = { }; + description = "Additional rust-motd service status entries keyed by display name."; + }; - last_login = { - john = 3; - root = 3; - }; + config = { + programs.rust-motd = { + enable = true; + refreshInterval = "*:0/5"; + order = [ + "global" + "last_login" + "service_status" + # "uptime" + "memory" + "filesystems" + ]; + settings = { + global = { + time_format = "%Y-%m-%d %H:%M:%S %Z"; + }; - service_status = { - Docker = "docker"; - SSH = "sshd.socket"; - "SSH Cert Renewal" = "step-ssh-host-renew.timer"; - "mTLS Renewal" = "mtls-renew.timer"; - }; + last_login = { + john = 3; + root = 3; + }; - # This calculation is wrong for LXCs - # uptime = { - # prefix = "Uptime"; - # }; + service_status = lib.mkMerge [ + defaultServiceStatus + config.loginText.extraServiceStatus + ]; - memory = { - swap_pos = "beside"; - }; + # This calculation is wrong for LXCs + # uptime = { + # prefix = "Uptime"; + # }; - filesystems = { - root = "/"; + memory = { + swap_pos = "beside"; + }; + + filesystems = { + root = "/"; + }; }; }; };