From d7483ed8505710033384d7fabad34470818bc760 Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Thu, 15 Feb 2024 15:41:07 -0600 Subject: Added dev path. Now to figure out how to make my own one-click packages --- modules/kfmon.nix | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'modules/kfmon.nix') diff --git a/modules/kfmon.nix b/modules/kfmon.nix index 33f6a9c..adb53bd 100644 --- a/modules/kfmon.nix +++ b/modules/kfmon.nix @@ -2,7 +2,10 @@ with builtins // lib; let cfg = config.kfmon; + ini = pkgs.formats.ini {}; importOption = p: (import p { inherit pkgs lib; } cfg.path).option; + + addSuffix = s: p: if hasSuffix s p then p else p + s; in { options.kfmon = { enable = mkEnableOption "KFMon"; @@ -13,13 +16,31 @@ in { description = "Relative path to kfmon within src"; }; + devPath = mkOption { + type = types.str; + default = "/mnt/onboard/${cfg.path}"; + readOnly = true; + internal = true; + }; + file = importOption ./lib/file.nix; manifest = importOption ./lib/manifest.nix; - # file = mkOption { - # type = options.file.type; - # default = {}; - # description = "Files relative to ${cfg.path}"; - # }; + + configs = mkOption { + type = types.attrsOf ini.type + default = {}; + description = '' + KFMon .ini config files. Do not touch this unless you know what you're doing! + ''; + }; }; + config.kfmon.file = mapAttrs' (n: v: { + name = addSuffix ".ini" n; + value = { + target = "config/${addSuffix ".ini" n}"; + text = generators.toINI {} v; + }; + }) cfg.configs; + } -- cgit v1.2.3