!9IQChSjwSHXPPWTa:lix.systems

Lix

808 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms235 Servers

Load older messages


SenderMessageTime
16 Feb 2025
@llakala:matrix.orgllakalahttps://github.com/llakala/llakaLib/blob/main/lib/collectDirectoryPackages.nix04:34:06
@charles:computer.surgeryCharlesoh interesting04:34:31
@llakala:matrix.orgllakalathe noogle documentation here is also really good04:34:48
@llakala:matrix.orgllakalahere's a usage example https://github.com/llakala/llakaLib/blob/2512d32d7812b62d27d9a63017fa1e4c91214d90/flake.nix#L4204:35:42
@charles:computer.surgeryCharlesoh i think i get it, this is very clever04:37:03
@charles:computer.surgeryCharles shouldn't localWrapper // pkgs be the other way aroudn? 04:37:48
@charles:computer.surgeryCharles * shouldn't localWrapper // pkgs be the other way around? 04:37:50
@llakala:matrix.orgllakalahmm will the order matter?04:38:03
@llakala:matrix.orgllakalaI guess maybe it will04:38:18
@llakala:matrix.orgllakalathat's smart04:38:20
@charles:computer.surgeryCharlesyes, values in the latter attrset with the same name take precedence04:38:20
@llakala:matrix.orgllakalawait yeah that's VERY smart04:38:30
@llakala:matrix.orgllakalaI'll make a note to fix that tomorrow, thanks :304:38:39
@charles:computer.surgeryCharles { a = "a"; } // { a = "b"; } -> { a = "b"; } for example 04:38:49
@charles:computer.surgeryCharles wait no actually i think localWrapper // pkgs is correct 04:40:45
@charles:computer.surgeryCharlesbecause if i try flipping them i get infinite recursion, but if i don't flip them, then it works04:41:00
@llakala:matrix.orgllakalait doesn't matter as much in this case, because merging with localWrapper results in a top-level attribute localPackages, e.g. ``` { pkgs, localPackages }: ``` but the only reason I HAD to create the localWrapper attribute was because of issues with shadowing, and swapping the order would've been an alternate way to fix it04:41:05
@charles:computer.surgeryCharles i'm not sure if it works as expected, but it at least evals 04:41:12
@llakala:matrix.orgllakala
In reply to @charles:computer.surgery
because if i try flipping them i get infinite recursion, but if i don't flip them, then it works
interesting
04:41:16
@llakala:matrix.orgllakalawill have to do some investigating into this04:41:43
@charles:computer.surgeryCharles the infinite recursion is because, for example, nixpkgs has displaycal and my scope also wants to have displaycal, and my scope's displaycal is defined in terms of nixpkgs' displaycal 04:42:51
@charles:computer.surgeryCharles if localWrapper takes precedence over pkgs, then this is obviously infinite recursion 04:43:16
@charles:computer.surgeryCharles but i suspect that also in this case if another local package wants to depend on displaycal, it will get the nixpkgs one instead of my overridden one 04:43:48
@charles:computer.surgeryCharlesohhhhhhhhhhhhhhhh04:49:13
@charles:computer.surgeryCharlesi'm stupid04:49:15
@charles:computer.surgeryCharlesthe reason i wasn't getting infinite recursion before is because i had an extra attrset in the way04:49:27
@charles:computer.surgeryCharles so i think what you have is actually fine, but you could also change it to just (localWrapper // extra) because i think including the stuff from pkgs is implied by using pkgs.newScope above 04:50:50
@llakala:matrix.orgllakala
In reply to @charles:computer.surgery
so i think what you have is actually fine, but you could also change it to just (localWrapper // extra) because i think including the stuff from pkgs is implied by using pkgs.newScope above
gotcha I'll try that
04:51:19
@charles:computer.surgeryCharlesif it doesn't work then just pretend i didn't say anything :P04:51:32
@charles:computer.surgeryCharles

tangentially related: Option<T> in nix:

some[T] = [true T];
none = [false];
option[T] = some[T] | none
05:16:35

Show newer messages


Back to Room ListRoom Version: 10