mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-04 20:22:14 +03:00
fix: exclude packagesDir and overridesDirs from invalidationHash
This commit is contained in:
parent
890183d2c6
commit
74e8474a21
@ -179,9 +179,31 @@
|
||||
source,
|
||||
translator,
|
||||
translatorArgs,
|
||||
}:
|
||||
}: let
|
||||
sanitizedPackagesDir = sanitizeRelativePath config.packagesDir;
|
||||
|
||||
localOverridesDirs =
|
||||
l.filter
|
||||
(oDir: ! l.hasPrefix l.storeDir oDir)
|
||||
config.overridesDirs;
|
||||
|
||||
sanitizedOverridesDirs = l.map sanitizeRelativePath localOverridesDirs;
|
||||
|
||||
filter = path: _:
|
||||
(baseNameOf path != "flake.nix")
|
||||
&& l.match ''.*/${sanitizedPackagesDir}'' path == null
|
||||
&& (l.any
|
||||
(oDir: l.match ''.*/${oDir}'' path == null)
|
||||
sanitizedOverridesDirs);
|
||||
|
||||
ca-source = builtins.path {
|
||||
path = source;
|
||||
name = "dream2nix-package-source";
|
||||
inherit filter;
|
||||
};
|
||||
in
|
||||
l.hashString "sha256" ''
|
||||
${source}
|
||||
${ca-source}
|
||||
${l.toJSON project}
|
||||
${translator}
|
||||
${l.toString
|
||||
@ -234,6 +256,14 @@
|
||||
sanitizeRelativePath = path:
|
||||
l.removePrefix "/" (l.toString (l.toPath "/${path}"));
|
||||
|
||||
sanitizePath = path: let
|
||||
absolute = (l.substring 0 1 path) == "/";
|
||||
sanitizedRelPath = l.removePrefix "/" (l.toString (l.toPath "/${path}"));
|
||||
in
|
||||
if absolute
|
||||
then "/${sanitizedRelPath}"
|
||||
else sanitizedRelPath;
|
||||
|
||||
traceJ = toTrace: eval: l.trace (l.toJSON toTrace) eval;
|
||||
in
|
||||
dlib
|
||||
|
Loading…
Reference in New Issue
Block a user