aboutsummaryrefslogtreecommitdiff
path: root/modules/scripts/motd
diff options
context:
space:
mode:
authortdback <tyler@tdback.net>2025-01-26 11:33:25 -0500
committertdback <tyler@tdback.net>2025-01-26 11:33:25 -0500
commitd4e6b5e506dd1e02c420807c3c3d5c975fce608f (patch)
treeb8791d5da9861bbcc4a52fbe3fe30abf5b61ad88 /modules/scripts/motd
parent3f33751dcb0cafb273eb868f230b1ae348437f89 (diff)
scripts: formatted scripts as modules
Diffstat (limited to 'modules/scripts/motd')
-rw-r--r--modules/scripts/motd/default.nix29
1 files changed, 14 insertions, 15 deletions
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.";
};
};