edolstra / flake-compat

MIT License
241 stars 72 forks source link

Support fetching file type flakes #44

Open matthewbauer opened 2 years ago

matthewbauer commented 2 years ago

Add supports for new type = "file" locks added in https://github.com/NixOS/nix/commit/5b8c1deb18e0e6fc7a83fb8101cf5fc8dba38843.

Unfortunately, the hash provided by the lock file is a recursive hash, while fetchurl wants a flat hash. So we have to use a custom fetchurl function using the builtin:fetchurl builder. Hopefully okay just to add compat for this very useful lock type.

cc @edolstra

jakeisnt commented 1 year ago

Is this ready to merge? Would love to be able to use this

matthewbauer commented 1 year ago

Should be! cc @edolstra

zimbatm commented 1 year ago

Hi, do you mind squashing all your commits? Then I will cherry-pick the patch into https://github.com/nix-community/flake-compat

edolstra commented 1 year ago

Doesn't this cause use of these inputs to be import-from-derivation? That doesn't seem desirable behaviour.