!UUqahLbShAYkkrXmKs:matrix.org

DevOS

36 Members
Seeking help and geeking out together on https://github.com/divnix/devos & https://github.com/divnix/digga10 Servers

Load older messages


SenderMessageTime
30 Jul 2021
@blaggacao:matrix.orgDavid Arnold (blaggacao)(if that makes sense)16:29:57
@d4hines:matrix.orgd4hinesAt this stage very little Nix usage makes sense to me 😆16:30:31
@d4hines:matrix.orgd4hinesI've read through some of the Nix pills and I've gotten DevOS working, and that's about it. It's quite a learning curve16:30:56
@d4hines:matrix.orgd4hinesSo any concrete examples would be super appreciated16:31:20
@blaggacao:matrix.orgDavid Arnold (blaggacao) RFC92 fit's in in that it "defers" evaluation of an "input from derivation" that wraps ecosystem tooling (like esy, etc.) so long as as a text hash of those defered insturctions can be always expected to produce the same outpu. 16:32:31
@blaggacao:matrix.orgDavid Arnold (blaggacao)* RFC92 fit's in in that it "defers" evaluation of an "input from derivation" that wraps ecosystem tooling (like esy, etc.) so long as as a text hash of those defered ecosystem instructions can be always expected to produce the same output16:32:52
@blaggacao:matrix.orgDavid Arnold (blaggacao)(or at least that is my understanding of that RFC)16:33:57
@blaggacao:matrix.orgDavid Arnold (blaggacao)
In reply to @d4hines:matrix.org
I've read through some of the Nix pills and I've gotten DevOS working, and that's about it. It's quite a learning curve
Honestly, I don't find the nix-pills super useful. But I guess we don't yet live up to rust standards in terms of docs 😃🦧
16:34:57
@d4hines:matrix.orgd4hines
In reply to @blaggacao:matrix.org
Honestly, I don't find the nix-pills super useful. But I guess we don't yet live up to rust standards in terms of docs 😃🦧
Do you have any recommendations on how to get to "journeyman status" in Nix?
16:36:11
@yusdacra:nixos.devyusdacraThe only docs I've read was the manuals, was enough for me personally. I got bored of nix pills 😛16:36:20
@yusdacra:nixos.devyusdacraOh and reading nixpkgs derivations.16:36:35
@blaggacao:matrix.orgDavid Arnold (blaggacao)
In reply to @d4hines:matrix.org
Do you have any recommendations on how to get to "journeyman status" in Nix?
For me, it was contributing to devos 😃😂
16:37:31
@blaggacao:matrix.orgDavid Arnold (blaggacao)The biggest hurdle was 1) no good IDE support 2) really awkward tracing and debugging workflows.16:38:21
@d4hines:matrix.orgd4hines"infinite recursion encountered" lol16:38:45
@d4hines:matrix.orgd4hinesThat's what I get whenever I try to modify the overlay16:39:00
@blaggacao:matrix.orgDavid Arnold (blaggacao) For tracing I find this flag useful: --override-input nixos path:/absolute/path/to/local/workdir/of/nixpkgs/with/a/few/traces 16:39:47
@yusdacra:nixos.devyusdacraHow does that help?16:40:11
@blaggacao:matrix.orgDavid Arnold (blaggacao)... at least it guarantees that you are eventually able to fijd the root cause without resorting to chances.16:40:38
@blaggacao:matrix.orgDavid Arnold (blaggacao)* ... at least it guarantees that you are eventually able to find the root cause without resorting to chances.16:40:45
@blaggacao:matrix.orgDavid Arnold (blaggacao)So I look at the backtraces and place a few traces in nixpkgs to understand what's really going on and then use that modified version of nixpkgs as an inout 16:41:24
@blaggacao:matrix.orgDavid Arnold (blaggacao)* So I look at the backtraces and place a few traces in nixpkgs to understand what's really going on and then use that modified version of nixpkgs as an input. 16:41:36
@blaggacao:matrix.orgDavid Arnold (blaggacao)* ... at least it guarantees that you are eventually able to find the root cause without resorting to rolling the dices.16:42:31
@blaggacao:matrix.orgDavid Arnold (blaggacao) Gytis Ivaskevicius has made a PR to nix to eventually improve that situation. 16:43:20
@yusdacra:nixos.devyusdacra
In reply to @blaggacao:matrix.org
So I look at the backtraces and place a few traces in nixpkgs to understand what's really going on and then use that modified version of nixpkgs as an input.
Ooooh
16:44:34
@blaggacao:matrix.orgDavid Arnold (blaggacao)https://github.com/NixOS/nix/pull/491416:44:34
@yusdacra:nixos.devyusdacraThat's useful16:46:01
@timdeh:matrix.org@timdeh:matrix.org

I find some common patterns that reliably cause infinite recursion:

  • careless use of rec in overlays
  • computation directly in an import

Both of these can be easily solved by using a let binding instead. Whenever I find infinite recursion and I can't trace it back to my local changes, i.e. tons of nixpkgs traces, I just start commenting stuff out until it works, and then work backwards from there 😅

16:46:35
@blaggacao:matrix.orgDavid Arnold (blaggacao)... buts somtimes chaos monkey dice rolling is quicker 😃🦧16:46:46
@yusdacra:nixos.devyusdacraI would love to add debugging traces to a nix library of mine, but using builtins.trace would print way too much stuff16:46:48
@blaggacao:matrix.orgDavid Arnold (blaggacao)
In reply to @timdeh:matrix.org

I find some common patterns that reliably cause infinite recursion:

  • careless use of rec in overlays
  • computation directly in an import

Both of these can be easily solved by using a let binding instead. Whenever I find infinite recursion and I can't trace it back to my local changes, i.e. tons of nixpkgs traces, I just start commenting stuff out until it works, and then work backwards from there 😅

I can complement:

  • Similar to rec, it can also happen with overlays and "recless" crossing of prev and final dependency.
  • Using flake self outside of an output value seems to cause that too.
16:48:54

Show newer messages


Back to Room ListRoom Version: 6