From c3052ddc4e54092bfc9220d550ab4d8fcba166de Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Wed, 11 Sep 2024 10:50:30 -0500 Subject: The modules seem fairly solid now. Now to write the cli --- modules/kfmon/default.nix | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'modules/kfmon/default.nix') diff --git a/modules/kfmon/default.nix b/modules/kfmon/default.nix index a2fcbb9..8ac50e4 100644 --- a/modules/kfmon/default.nix +++ b/modules/kfmon/default.nix @@ -83,23 +83,37 @@ in { kfmon.file = mapAttrs' (n: v: { name = "kfmon-config-${n}"; value = { - text = generators.toINI {} v; + text = generators.toINI { + mkKeyValue = generators.mkKeyValueDefault {} " = "; + } v; target = let - fixedN = if isSuffix ".ini" n then n else "${n}.ini"; + fixedN = if hasSuffix ".ini" n then n else "${n}.ini"; in "config/${fixedN}"; }; - }); + }) cfg.configs; + + kfmon.configs = { + kfmon.daemon = { + db_timeout = 500; + use_syslog = 0; + with_notifications = 1; + }; + kfmon-log.watch = { + filename = "/mnt/onboard/icons/kfmon.png"; + action = "${cfg.devicePath}/bin/kfmon-printlog.sh"; + label = "Show KFMon log"; + hidden = 1; + block_spawns = 0; + do_db_update = 0; + db_title = "KFMon Log"; + db_author = "NiLuJe"; + db_comment = "Print the last few lines of KFMon's log"; + }; + }; } (mkIf cfg.enable { koboroot.include = singleton cfg.finalPackage; - # koboroot.include = [ - # (pkgs.linkFarm [{ - # name = cfg.devicePath; - # path = cfg._allFiles; - # }]) - # cfg.package.KoboRoot - # ]; }) ]; } -- cgit v1.2.3