diff --git a/modules/crans/default.nix b/modules/crans/default.nix index cac4a63..4d58438 100644 --- a/modules/crans/default.nix +++ b/modules/crans/default.nix @@ -14,6 +14,7 @@ in ./ntp.nix ./restic_client.nix ./monitoring.nix + ./motd.nix ./nullmailer.nix ./packages.nix ./ssh.nix diff --git a/modules/crans/motd.nix b/modules/crans/motd.nix new file mode 100644 index 0000000..cc6cdcd --- /dev/null +++ b/modules/crans/motd.nix @@ -0,0 +1,33 @@ +{ config, lib, ... }: +let + phrase = v: if v.cond then ''[0m> [38;5;82m${v.name}[0m a été déployé sur cette machine. \n'' else ""; + importantPackages = [ + { + name = "Collabora"; + cond = config.services.collabora-online.enable; + } + { + name = "Jitsi"; + cond = config.services.jitsi-meet.enable; + } + { + name = "NextCloud"; + cond = config.services.nextcloud.enable; + } + { + name = "NGINX"; + cond = config.services.nginx.enable; + } + { + name = "Restic (Client)"; + cond = config.crans.resticClient.enable; + } + { + name = "Restic (Server)"; + cond = config.crans.services.resticServer.enable; + } + ]; +in +{ + users.motd = lib.concatStringsSep "\n" (map phrase importantPackages); +}