flake-compat
flake-compat copied to clipboard
Fix pure evaluation mode
Currently flake-compat fails in pure evaluation mode, due to the rootSrc cleaning. I suspect we could just add another conditional to https://github.com/edolstra/flake-compat/blob/12c64ca55c1014cdc1b16ed5a804aa8576601ff2/default.nix#L104 to not tryFetchGet when not builtins ? currentSystem
In my flakes I started using the following default.nix to avoid this issue:
(
import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{
src =
if builtins ? currentSystem
then ./.
else "${./.}";
}
)
.defaultNix