chore(eval-cache): reword some internals

This commit is contained in:
DavHau 2023-02-17 13:55:29 +07:00
parent 03c9433805
commit 3665fe169b
2 changed files with 9 additions and 11 deletions

View File

@ -29,16 +29,14 @@
# SAVE
content = intersectAttrsRecursive fields config;
currentContent = intersectAttrsRecursive fields config;
cache-content = {
inherit
content
invalidationHash
;
newCache = {
inherit invalidationHash;
content = currentContent;
};
newFile' = config.deps.writeText "cache.json" (l.toJSON cache-content);
newFile' = config.deps.writeText "cache.json" (l.toJSON newCache);
newFile = config.deps.runCommand "cache.json" {} ''
cat ${newFile'} | ${config.deps.jq}/bin/jq > $out
'';
@ -95,9 +93,9 @@
# use the content without going through the cache.
loadedContent =
if ! cacheFileExists
then cacheMissingError content
then cacheMissingError currentContent
else if ! cacheFileValid
then cacheInvalidError content
then cacheInvalidError currentContent
else mapCachePrio cache.content;
configIfEnabled = l.mkIf (cfg.enable) {
@ -126,7 +124,7 @@
};
configIfDisabled = l.mkIf (! cfg.enable) {
eval-cache.content = content;
eval-cache.content = currentContent;
};
in {

View File

@ -8,7 +8,7 @@ in {
# GLOBAL OPTIONS
repoRoot = l.mkOption {
type = t.path;
description = "The root of the own repo. Eg. 'self' in a flake";
description = "The root of the current repo. Eg. 'self' in a flake";
example = lib.literalExample ''
self
'';