From a54f20d779d1fd1b16b14ae3ae0af471864ee25e Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 13 Aug 2024 20:59:43 +0200 Subject: [PATCH] modules/motd: use fixed rev --- modules/motd/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/motd/default.nix b/modules/motd/default.nix index be403a6..91417e1 100644 --- a/modules/motd/default.nix +++ b/modules/motd/default.nix @@ -1,4 +1,4 @@ -{ config, depot, pkgs, ... }: +{ cluster, config, depot, pkgs, ... }: { users.motd = builtins.readFile ./motd.txt; environment.interactiveShellInit = let @@ -8,6 +8,11 @@ grep = exec pkgs.gnugrep "grep"; countUsers = '' ${util "who"} -q | ${util "head"} -n1 | ${util "tr"} ' ' \\n | ${util "uniq"} | ${util "wc"} -l''; countSessions = '' ${util "who"} -q | ${util "head"} -n1 | ${util "wc"} -w''; + + rev = if cluster.config.simulacrum then + "simulacrum" + else + depot.rev or "\${BRED}(✘)\${CO}\${BWHITE} Dirty"; in '' ( # Reset colors @@ -40,7 +45,7 @@ echo -e " █ ''${BGREEN}(✓)''${CO} ''${BWHITE}You are using a genuine Private Void™ system.''${CO}" echo " █" echo -e " █ ''${BWHITE}OS Version....:''${CO} NixOS ''${CAB}${config.system.nixos.version}''${CO}" - echo -e " █ ''${BWHITE}Configuration.:''${CO} ''${CAB}${depot.rev or "\${BRED}(✘)\${CO}\${BWHITE} Dirty"}''${CO}" + echo -e " █ ''${BWHITE}Configuration.:''${CO} ''${CAB}${rev}''${CO}" echo -e " █ ''${BWHITE}Uptime........:''${CO} $(${uptime} -p | ${util "cut"} -d ' ' -f2- | GREP_COLORS='mt=01;35' ${grep} --color=always '[0-9]*')" echo -e " █ ''${BWHITE}SSH Logins....:''${CO} There are currently ''${CAB}$(${countUsers})''${CO} users logged in on ''${CAB}$(${countSessions})''${CO} sessions" )