mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-25 23:41:42 +03:00
chore(eval-cache): reword some internals
This commit is contained in:
parent
03c9433805
commit
3665fe169b
@ -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 {
|
||||
|
@ -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
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user