aboutsummaryrefslogtreecommitdiff
path: root/modules/scripts/motd
diff options
context:
space:
mode:
authortdback <tyler@tdback.net>2025-01-16 19:57:13 -0500
committertdback <tyler@tdback.net>2025-01-16 19:57:13 -0500
commit88017f5a874478dd82f306a5df88c38a8d06fcb6 (patch)
tree8806c58c4f21bb6a56d8530df8a93b256d44b4f3 /modules/scripts/motd
parent01d012473d4311d4f4e5a0831d912bc4b8c61639 (diff)
fix: format flake with `nixfmt-rfc-style`
Diffstat (limited to 'modules/scripts/motd')
-rw-r--r--modules/scripts/motd/default.nix19
1 files changed, 14 insertions, 5 deletions
diff --git a/modules/scripts/motd/default.nix b/modules/scripts/motd/default.nix
index c4b0c6b..6d95119 100644
--- a/modules/scripts/motd/default.nix
+++ b/modules/scripts/motd/default.nix
@@ -1,4 +1,9 @@
-{ config, lib, pkgs, ... }:
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
with lib;
let
cfg = config.programs.motd;
@@ -35,9 +40,12 @@ let
printf "\n"
printf "''${BOLD}Good $TIME $(whoami), welcome to $(hostname)!$ENDCOLOR\n"
printf "\n"
- ${strings.concatStrings (lists.forEach cfg.networkInterfaces (
- int: "printf \"$BOLD * %-20s$ENDCOLOR %s\\n\" \"IPv4 ${int}\" \"$(ip -4 addr show ${int} | grep -oP '(?<=inet\\s)\\d+(\\.\\d+){3}')\"\n"
- ))}
+ ${strings.concatStrings (
+ lists.forEach cfg.networkInterfaces (
+ int:
+ "printf \"$BOLD * %-20s$ENDCOLOR %s\\n\" \"IPv4 ${int}\" \"$(ip -4 addr show ${int} | grep -oP '(?<=inet\\s)\\d+(\\.\\d+){3}')\"\n"
+ )
+ )}
printf "$BOLD * %-20s$ENDCOLOR %s\n" "Release" "$(awk -F= '/PRETTY_NAME/ { print $2 }' /etc/os-release | tr -d '"')"
printf "$BOLD * %-20s$ENDCOLOR %s\n" "Kernel" "$(uname -rs)"
printf "\n"
@@ -68,7 +76,8 @@ let
done <<< "$SERVICES"
printf "\n"
'';
-in {
+in
+{
options = {
programs.motd = {
enable = mkEnableOption "motd";