Skip to content

Conversation

@matthewbauer
Copy link
Member

@matthewbauer matthewbauer commented Aug 26, 2022

Add supports for new type = "file" locks added in
NixOS/nix@5b8c1de.

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

Fixes #44.

Add supports for new type = "file" locks added in
NixOS/nix@5b8c1de.

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.
Add support for local files in addition to http / https.
so that fetchurl outputs a real path instead of a source, and our
hashes match correctly between flake and non-flake.

also it looks like fetchTarball can support local files
@jakeisnt
Copy link

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

@matthewbauer
Copy link
Member Author

Should be! cc @edolstra

0z13 added a commit to 0z13/flake-compat that referenced this pull request Mar 16, 2023
@zimbatm
Copy link
Member

zimbatm commented Jun 23, 2023

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

@edolstra
Copy link
Member

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

lix-project-bot pushed a commit to lix-project/flake-compat that referenced this pull request Mar 21, 2025
The goal here is that we have an ability to develop flake-compat and
actually have tests and be able to validate it is correct.

This also imports the file input stuff originally written by
matthewbauer here: NixOS/flake-compat#44

This bore fruit already in the form of finding a years old bug lying
around in Lix:
https://git.lix.systems/lix-project/lix/issues/750
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants