From d4e6b5e506dd1e02c420807c3c3d5c975fce608f Mon Sep 17 00:00:00 2001 From: tdback Date: Sun, 26 Jan 2025 11:33:25 -0500 Subject: scripts: formatted scripts as modules --- modules/scripts/motd/default.nix | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'modules/scripts/motd/default.nix') diff --git a/modules/scripts/motd/default.nix b/modules/scripts/motd/default.nix index 6d95119..5185797 100644 --- a/modules/scripts/motd/default.nix +++ b/modules/scripts/motd/default.nix @@ -6,9 +6,10 @@ }: with lib; let - cfg = config.programs.motd; + script = "motd"; + cfg = config.modules.scripts.${script}; - motd = pkgs.writeShellScriptBin "motd" '' + motd = pkgs.writeShellScriptBin script '' RED="\e[31m" GREEN="\e[32m" YELLOW="\e[33m" @@ -78,19 +79,17 @@ let ''; in { - options = { - programs.motd = { - enable = mkEnableOption "motd"; - networkInterfaces = mkOption { - default = [ ]; - type = types.listOf types.str; - description = "Network interfaces to monitor."; - }; - servicesToCheck = mkOption { - default = [ ]; - type = types.listOf types.str; - description = "Services to validate alongside podman containers."; - }; + options.modules.scripts.${script} = { + enable = mkEnableOption script; + networkInterfaces = mkOption { + default = [ ]; + type = types.listOf types.str; + description = "Network interfaces to monitor."; + }; + servicesToCheck = mkOption { + default = [ ]; + type = types.listOf types.str; + description = "Services to validate alongside podman containers."; }; }; -- cgit v1.2.3