permafrost/modules/motd.nix

51 lines
1.1 KiB
Nix
Raw Permalink Normal View History

2024-12-27 23:31:44 -08:00
{ lib, config, ... }:
let
cfg = config.permafrost.motd;
in
{
options.permafrost.motd = {
enable = lib.mkEnableOption "nginx nixos module";
};
config = lib.mkIf cfg.enable {
2024-12-28 00:48:29 -08:00
systemd.services.rust-motd.serviceConfig = {
Group = "nginx";
};
2024-12-27 23:31:44 -08:00
programs.rust-motd.enable = true;
2024-12-28 00:48:29 -08:00
programs.rust-motd.order = [
"last_run"
"uptime"
"s_s_l_certs"
"filesystems"
2024-12-28 00:58:25 -08:00
"memory"
2024-12-28 00:48:29 -08:00
"docker"
"service_status"
"last_login"
];
2024-12-27 23:31:44 -08:00
programs.rust-motd.settings = {
2024-12-28 00:58:25 -08:00
uptime.prefix = "up";
filesystems.root = "/";
2024-12-28 00:48:29 -08:00
service_status = {
Foundry = "foundry";
Nginx = "nginx";
Nyazoom = "nyazoom";
};
2024-12-27 23:31:44 -08:00
docker = {
"/forgejo" = "Forgejo";
2024-12-28 00:39:23 -08:00
"/ddb-importer-ddb-proxy-1" = "ddb-proxy";
2024-12-27 23:31:44 -08:00
};
2024-12-28 00:48:29 -08:00
s_s_l_certs = lib.mkIf config.permafrost.acme.enable {
sort_method = "manual";
certs = {
"scarlet.zynh.me" = "${config.security.acme.certs.permafrost.directory}/fullchain.pem";
};
};
2024-12-28 00:58:25 -08:00
memory.swap_pos = "beside";
last_login.ravenshade = 3;
2024-12-28 00:48:29 -08:00
last_run = { };
2024-12-27 23:31:44 -08:00
};
};
}