| 1 Feb 2026 |
antifuchs | (grep's still running on my store, btw) | 19:25:16 |
vczf | In reply to @antifuchs:asf.computer (grep's still running on my store, btw) grep -rnFe determinateNix /nix/store/*-source* might work better | 19:38:59 |
vczf | Not at my computer right now though | 19:39:13 |
vczf | In reply to @antifuchs:asf.computer (grep's still running on my store, btw) * grep -rnFe determinateNix /nix/store/-source/**.nix` might work better | 19:41:04 |
antifuchs | yeah, I probably could do something smarter with find/xargs there | 19:41:30 |
antifuchs | find /nix/store -type f -name \*.nix -print0 | xargs -0 grep -l determinateNix so I don't run into argv limits | 19:42:20 |
vczf | Or **/*.nix as the grep arg should work | 19:43:39 |
K900 | rg -t nix determinateNix ez | 19:45:02 |
antifuchs | In reply to @vczf:matrix.org Or **/*.nix as the grep arg should work Not in my shell, no. But anyways I’m off to walk the dog, should be done by then | 19:47:26 |
antifuchs | (Also I don’t trust rg’s file selection mechanisms at all, unless I’m in a git repo. Been burned too many times by that) | 19:47:57 |
vczf | Oh lol ripgrep is almost 10 years old and I still haven’t gotten around to trying it | 19:48:27 |
0x4fbb09 it/its ⛯✇ΘΔ | the automatic exclusions? | 19:48:35 |
toonn | Start today! | 19:48:41 |
0x4fbb09 it/its ⛯✇ΘΔ | yeah, rg -uuu is the way to specify "search absolutely everything" | 19:49:14 |
antifuchs | I felt like I could trust it once, then the cli changed and I haven’t trusted it since. Maybe in 10 years I will use that again, but for now? Nah | 20:18:59 |
antifuchs | It’s great in git repos tho! | 20:19:44 |
Sofie 🏳️⚧️ (she/her) | rip grep all 😭 | 20:24:33 |
| zimward changed their display name from zimward @fosdem to zimward. | 20:36:21 |
rosssmyth | Main thing ripgrep messes up on in my experience is with .gitignore because it uses a parser that is not very good | 22:57:43 |
| 2 Feb 2026 |
antifuchs | update, it's virby, a linux-in-a-rosetta-vm builder for darwin. oh well. | 01:34:24 |
| holly [nexus] 🏳️⚧️ joined the room. | 07:27:17 |
Psentee | Is there any explanation for what nix does when installable's --file/--expr result is a function (return a function or call it)? I (somewhat) figured out the behaviour, couldn't find it documented anywhere and can't figure out if it's intentional and if I can rely on that. Here's what I found, on a nix eval example, but run & build seem to do the same:
- First thing I noticed is
nix eval -f '<nixpkgs>' hello returns the derivation (it calls (import <nixpkgs> {}).hello rather than use (import <nixpkgs>).hello. It also processes --arg/--argstr. I feel that the <nixpkgs> behaviour is (somewhat) intentional
- But
nix eval -f '<nixpkgs>' returns «lambda @ /nix/store/i88d8nffxs0n79mzgzrpnkiri3yi4isr-source/pkgs/top-level/impure.nix:12:1» rather than toplevel pkgs attrset
- A raw lambda expression behaves similar:
nix eval --expr '{...}@args: { inherit args; }' shows «lambda @ «string»:1:1», and nix eval --expr '{...}@args: { inherit args; }' args shows { }
- But if I drop the
{...} in function's signature, it stops calling the function: nix eval --expr 'args: { inherit args; }' is «lambda @ «string»:1:1», and nix eval --expr 'args: { inherit args; }' args throws error: the value being indexed in the selection path 'args' at '' should be a set but is a function: «lambda @ «string»:1:1»
- Both
nix eval --expr '{ __functor = args: { inherit args; }; }' and nix eval --expr '{ __functor = {...}@args: { inherit args; }; }' never call. Both forms return { __functor = «lambda __functor @ «string»:1:15»; }, with or without args (args attribute path is ignored, it always returns the expr result)
- Adding
__functionArgs = {}; to the previous one doesn't change anything: it never calls and ignores the attribute path
- Now I've read up on functors, and both forms above should have failed: evaluating
{ __functor = args: { inherit args; }; } 23 throws error: attempt to call something which is not a function but a set: { args = { __functor = «lambda __functor @ «string»:1:15»; }; } (missing the "self" first argument), only this form returns 23: { __functor = _self: args: { inherit args; }; } 23
- But if I add the missing arg,
nix eval --expr '{ __functor = self: args: { inherit args; }; }' args, I get error: the value being indexed in the selection path 'args' at '' should be a set but is a function: «lambda __functor @ «string»:1:21»
- Without attrpath it doesn't attempt to call:
nix eval --expr '{ __functor = self: args: { inherit args; }; }' returns { __functor = «lambda __functor @ «string»:1:15»; }
Now some of this is intentional, some of this is accidental, and some of this is a bug (I'm 92% convinced that calling __functor just once (only with self and not with actual args) is some kind of a bug). None of this seems documented (or I couldn't find it). Can I rely on any of it? How to make it make sense?
| 11:39:55 |
Psentee | (is the answer "The nix CLI is as much of a mess as flakes are, and without flakes you should be using the old CLI"? I like the nix CLI, even without flakes, and so far I've avoided learning the old incantations, I hope to continue using nix, but I'll accept "this CLI is irreparable mess, don't expect any better" as an answer) | 11:42:32 |
K900 | Autocalling was a mistake | 11:48:17 |
piegames | In reply to @psentee:matrix.org (is the answer "The nix CLI is as much of a mess as flakes are, and without flakes you should be using the old CLI"? I like the nix CLI, even without flakes, and so far I've avoided learning the old incantations, I hope to continue using nix, but I'll accept "this CLI is irreparable mess, don't expect any better" as an answer) It is an irreparable mess, however this specific mess is one that got inherited almost 1:1 form the old CLI | 11:52:12 |
Psentee | Huh. Functors aside, is there any situation where a «lambda …» from nix eval/nix build/nix run would be useful? Trying to call it seems like a good attempt to arrive at something useful. Especially when there are explicit --arg / --argstr switches (I'd say if these switches are set it's no longer "auto"calling, it's requested by user) | 11:52:22 |
piegames | Notably, autocalling only works for functions with an attrset destructuring | 11:52:39 |
piegames | In reply to @psentee:matrix.org Huh. Functors aside, is there any situation where a «lambda …» from nix eval/nix build/nix run would be useful? Trying to call it seems like a good attempt to arrive at something useful. Especially when there are explicit --arg / --argstr switches (I'd say if these switches are set it's no longer "auto"calling, it's requested by user) Yes, fpr denugging purposes | 11:53:16 |
K900 | In reply to @piegames:flausch.social Notably, autocalling only works for functions with an attrset destructuring In argument position | 11:53:59 |
Psentee | IMO a reasonable consistent behaviour would be "if --file/--expr is a function, always call" (if function won't take the args we have, then it's an error). For debugging purposes, one switch could disable that. (Or the reverse: an explicit --arg/--argstr would enable calling – now it doesn't seem to change the behaviour at all, it's just a NOP half the time) | 11:56:30 |