diff options
| author | Chris Wells <chris@mathematicaster.org> | 2024-09-10 14:51:28 -0500 |
|---|---|---|
| committer | Chris Wells <chris@mathematicaster.org> | 2024-09-10 14:51:28 -0500 |
| commit | 4f471484b3a1e16230979a8406503a220b9101f4 (patch) | |
| tree | dc3f5256f275f34d3bcc9573462ed34c7fd97f77 /modules/kfmon/default.nix | |
| parent | 5cb16c34a8c5b803ec723934c1dc828c0e8e3bad (diff) | |
| download | kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar.gz kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar.bz2 kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar.lz kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar.xz kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar.zst kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.zip | |
I think this is almost working!
Diffstat (limited to 'modules/kfmon/default.nix')
| -rw-r--r-- | modules/kfmon/default.nix | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/modules/kfmon/default.nix b/modules/kfmon/default.nix index ac20b86..a2fcbb9 100644 --- a/modules/kfmon/default.nix +++ b/modules/kfmon/default.nix @@ -29,16 +29,44 @@ in { apply = filterAttrs (_: v: v.enable); }; - _allFiles = mkOption { + _createdFiles = mkOption { type = types.package; internal = true; readOnly = true; - default = pkgs.symlinkJoin { - name = "kfmon-files"; - paths = mapAttrsToList (v: v._package) cfg.file; + default = pkgs.buildEnv { + name = "kfmon-files-created"; + paths = mapAttrsToList (_: v: v._package) cfg.file; + extraPrefix = cfg.devicePath; }; }; + finalPackage = mkOption { + type = types.package; + internal = true; + readOnly = true; + default = pkgs.mergePaths { + name = "kfmon-package"; + paths = [ + (pkgs.linkFarm "kfmon" [{ + name = removePrefix "/" cfg.devicePath; + path = cfg.package.out; + }]) + cfg._createdFiles + cfg.package.KoboRoot + ]; + }; + }; + + # _allFiles = mkOption { + # type = types.package; + # internal = true; + # readOnly = true; + # default = pkgs.symlinkJoin { + # name = "kfmon-files"; + # paths = mapAttrsToList (v: v._package) cfg.file; + # }; + # }; + configs = mkOption { type = types.attrsOf ini.type; default = {}; @@ -50,6 +78,8 @@ in { config = mkMerge [ { + info.kfmon = cfg.enable; + kfmon.file = mapAttrs' (n: v: { name = "kfmon-config-${n}"; value = { @@ -62,13 +92,14 @@ in { }); } (mkIf cfg.enable { - koboroot.include = [ - (pkgs.linkFarm [{ - name = cfg.devicePath; - path = cfg._allFiles; - }]) - cfg.package.KoboRoot - ]; + koboroot.include = singleton cfg.finalPackage; + # koboroot.include = [ + # (pkgs.linkFarm [{ + # name = cfg.devicePath; + # path = cfg._allFiles; + # }]) + # cfg.package.KoboRoot + # ]; }) ]; } |
