Update readme #67

Closed
cobaltcause wants to merge 0 commits from cobaltcause/flake-compat:readme into main
Member

Remove a stale warning, fix a documentation bug, document another thing.

Remove a stale warning, fix a documentation bug, document another thing.
Because it isn't anymore.
That would break when:

* A flake.lock is created
* The main branch is updated
* The user doesn't have the tarball corresponding to the previous
  version of the main branch in their store

because the hashes won't match.
Some projects like to set `flake = false` for all inputs; this is
good for them to know so they can stay consistent about it.
This probably only works for forgejo-ish things.
README.md Outdated
@ -22,2 +7,3 @@
```nix
inputs.flake-compat.url = "https://git.lix.systems/api/v1/repos/lix-project/flake-compat/archive/main.tar.gz";
inputs.flake-compat = {
url = "git+https://git.lix.systems/lix-project/flake-compat";
Owner

this should be using an archive URL, i think.

https://git.lix.systems/lix-project/flake-compat/archive/main.tar.gz

this should be using an archive URL, i think. https://git.lix.systems/lix-project/flake-compat/archive/main.tar.gz
Author
Member

I introduced this in the commit:

don't depend on input that can change

That would break when:

* A flake.lock is created
* The main branch is updated
* The user doesn't have the tarball corresponding to the previous
  version of the main branch in their store

because the hashes won't match.

which is my reasoning for making that change. It's possible I'm wrong about this, though; what do you think?

I introduced this in the commit: ``` don't depend on input that can change That would break when: * A flake.lock is created * The main branch is updated * The user doesn't have the tarball corresponding to the previous version of the main branch in their store because the hashes won't match. ``` which is my reasoning for making that change. It's possible I'm wrong about this, though; what do you think?
Author
Member

If the concern is about the value passed to builtins.fetchTarball, that still uses an archive link. The lock object for the git+https input looks like this:

"flake-compat": {
  "flake": false,
  "locked": {
    "lastModified": 1732560995,
    "narHash": "sha256-ZWB9T9BdjXibkwtw9RwBCKTHZmsn5NTfxWzUxLz8B1w=",
    "ref": "main",
    "rev": "33a2aba01c786004d9ab5580ea426f450d4a2238",
    "revCount": 63,
    "type": "git",
    "url": "https://git.lix.systems/lix-project/flake-compat"
  },
  "original": {
    "ref": "main",
    "type": "git",
    "url": "https://git.lix.systems/lix-project/flake-compat"
  }
}

and the builtins.fetchTarball URL is constructed from "${flake-compat.locked.url}/archive/${flake-compat.locked.rev}.tar.gz" which works in my testing.

If the concern is about the value passed to `builtins.fetchTarball`, that still uses an archive link. The lock object for the `git+https` input looks like this: ``` "flake-compat": { "flake": false, "locked": { "lastModified": 1732560995, "narHash": "sha256-ZWB9T9BdjXibkwtw9RwBCKTHZmsn5NTfxWzUxLz8B1w=", "ref": "main", "rev": "33a2aba01c786004d9ab5580ea426f450d4a2238", "revCount": 63, "type": "git", "url": "https://git.lix.systems/lix-project/flake-compat" }, "original": { "ref": "main", "type": "git", "url": "https://git.lix.systems/lix-project/flake-compat" } } ``` and the `builtins.fetchTarball` URL is constructed from `"${flake-compat.locked.url}/archive/${flake-compat.locked.rev}.tar.gz"` which works in my testing.
Owner

oh, okay. that makes sense and works. sounds good to me.

oh, okay. that makes sense and works. sounds good to me.
jade marked this conversation as resolved
jade closed this pull request 2024-11-26 06:45:34 +00:00
Owner

haunted?? i merged this and it didnt get marked merged

haunted?? i merged this and it didnt get marked merged

Pull request closed

Sign in to join this conversation.
No description provided.