Nix Hackers | 962 Members | |
| For people hacking on the Nix package manager itself | 203 Servers |
| Sender | Message | Time |
|---|---|---|
| 7 Aug 2021 | ||
* Only top-level flake nixConfig gets applied | 19:57:58 | |
| i see. This means any other input flakes would use the overridden registry? | 19:59:38 | |
In reply to @tomberek:matrix.orgOther flakes won't use the registry at all, unless they are missing a lockfile. | 20:01:47 | |
| In which case yes, they would be using that registry when you update the top-level flake. | 20:02:04 | |
| Besides, this PR doesn't actually change any of this behavior, that was done in https://github.com/NixOS/nix/pull/4969 | 20:03:04 | |
This just whitelists nixConfig.flake-registry so that it can be used in non-interactive settings, e.g. an automatic update bot (https://github.com/serokell/update-daemon) | 20:03:41 | |
Currently we hack this by adding .local/share/nix/trusted-settings.json with the relevant value, but since flake-registry is safe to set we can avoid that. | 20:04:36 | |
okay, then the PR seems fine, but the underlying semantics are what I'm trying to understand. At first glance it seems an input adding or removing a .lock might be unexpected. Can you share about what the right mental model is for this? | 20:06:23 | |
It is safe to set because it should be exactly the same as just setting inputs in the flake. | 20:06:20 | |
In reply to @tomberek:matrix.orgI'm not sure I understand the question. | 20:06:49 | |
The flake registry is not the source of truth for most flakes, flake.lock is. | 20:07:13 | |
And even in flakes that don't have flake.lock, the registry only matters for indirect inputs, which should be avoided in such situations. | 20:07:39 | |
The slightly unexpected thing is that if you set nixConfig.flake-registry, don't add any explicit inputs, don't commit the lockfile, and then use your flake in another flake you will get different input versions (or it wouldn't work at all) | 20:08:25 | |
| a project that does not have a flake.lock inherits the registry resolution from the very top. Otherwise it is not impacted. (i'm just thinking through it...) | 20:08:51 | |
| Yes, exactly. | 20:09:02 | |
| Okay... then i'd want some sort of warning at least if the underlying flake adds/removes their lock. (compared to the last time i updated my flake.lock). | 20:11:35 | |
| That would be fairly difficult to implement | 20:12:06 | |
We don't keep how we got the input versions in flake.lock | 20:12:37 | |
My thought is that it's a bigger change than one would normally expect because the semantics change a bit. Is there a warning just in the situation that there is no flake.lock? | 20:13:58 | |
In reply to @tomberek:matrix.orgThe PR in question doesn't change anything apart from the interactivity requirement for this particular setting. | 20:15:18 | |
| Yes, sorry. It's a slightly wider question than your PR. | 20:16:11 | |
| I think we can add an informative output any time there is no flake.lock for an input flake.
| 20:22:31 | |
| hrm... that would be super noisy with nixpkgs | 20:49:51 | |
| * I think we can add an informative output any time there is no flake.lock for an input flake.
| 21:06:48 | |
| 8 Aug 2021 | ||
Wasn't Nix going to support storing Git repositories natively in /nix/store? I seem to remember an issue about it on https://github.com/NixOS/nix. | 15:24:01 | |
| 15:27:54 | ||
| #1006 has discussion ^^^^ | 15:31:47 | |
| Thanks! | 15:32:33 | |
| 22:48:52 | ||
| 9 Aug 2021 | ||
i wonder if there's even a way to fix https://github.com/NixOS/nix/blob/master/src/libexpr/symbol-table.hh#L79 easily... maybe using std::unordered_set::count first to find the key without too many allocations and making life a bit easier for our GC? But of course that adds CPU overhead by doing the lookup twice... | 08:47:22 | |