!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1933 Members
Nix programming language363 Servers

Load older messages


SenderMessageTime
11 Jun 2021
@b:chreekat.netbryan joined the room.10:22:20
@chreekat:matrix.org@b:chreekat.net left the room.10:25:08
@t_unix:matrix.orgt_unix joined the room.10:27:51
@t_unix:matrix.orgt_unixhi10:27:58
@t_unix:matrix.orgt_unix

I'd like to output a multi line string that contains hash (#) characters. Like:

${if stdenv.targetPlatform.isAarch32 then ''
# some comment related to stuff below
...
''
10:29:58
@t_unix:matrix.orgt_unixis that correct?10:30:14
@t_unix:matrix.orgt_unix repl says it should be fine. Same result for using double quotes instead of two single quotes 10:33:32
@b:chreekat.netbryanThe repl can be trusted :)10:36:34
@aaronjanse:matrix.orgaaronjanse
In reply to @andrew:mtx.rew.la
right, but the issue isn't limited to pkgs, anything can be passed to a function, so we don't know the context in which the function is called without reading the module which calls it
Yep. I hope to address this in nix-eval-lsp by remembering what arguments are passed to a function. On flakes NixOS, you'd then evaluate the flake's nixosConfiguration to get the pkgs argument cached. On non-flakes NixOS, you'd have an in-memory expression like import /etc/nixos/configuration.nix { pkgs = import <nixpkgs>; } that would tell nix-eval-lsp what the pkgs argument may be
19:20:07
@aaronjanse:matrix.orgaaronjanseThat should actually be straightforward to add to nix-eval-lsp. I just need to figure out the cause of some performance issues I was having19:21:14
@andrew:mtx.rew.laandrew that good news, thanks aaronjanse 19:28:11
@andrew:mtx.rew.laandrew I ran into another issue, do you have thoughts on whether nix-eval-lsp will be able to handle getting the definition of x in (e.g.) pkgs.python3.withPackages (x:... 19:29:51
@aaronjanse:matrix.orgaaronjanseOnce I implement the above feature, it should be able to get the value of x and show where its value is defined (i.e. the part of the withPackages implementation that calls the lambda the user passes)19:31:01
@aaronjanse:matrix.orgaaronjanse It should also be able to do stuff like autocomplete within with x; inside that lambda 19:31:18
@andrew:mtx.rew.laandrew very cool, nix-eval-parser could have very many uses in the nix ecosystem 19:59:20
@andrew:mtx.rew.laandrew * very cool, nix-eval-parser could have quite a few uses in the nix ecosystem 19:59:32
@aaronjanse:matrix.orgaaronjanse
In reply to @andrew:mtx.rew.la
very cool, nix-eval-parser could have quite a few uses in the nix ecosystem
Like nix-eval-lsp but as a Rust crate?
20:05:27
@andrew:mtx.rew.laandrewI was thinking things like an incremental evaluator, great debugging tool20:05:58
@aaronjanse:matrix.orgaaronjanseEither way, yeah I'm excited to see what stuff is now possible. I look forward to seeing what happens with https://github.com/nix-community/rnix-lsp/pull/3820:06:22
@aaronjanse:matrix.orgaaronjanse
In reply to @andrew:mtx.rew.la
I was thinking things like an incremental evaluator, great debugging tool
That would be great
20:06:38
@jez:petrichor.meJez (he/him)Surely this means we're not that far off being able to rewrite the whole of nix in Rust? 😜20:11:37
@andrew:mtx.rew.laandrew aaronjanse: I hope they review it. Otherwise it might make sense to just merge rnix-lsp in 20:11:52
@nodeven:matrix.orgnodeven joined the room.21:13:06
@nodeven:matrix.orgnodeven changed their display name from node to nodeven.22:52:46
12 Jun 2021
@jtojnar:matrix.orgJan Tojnar aaronjanse: we could definitely use the evaluation for nixpkgs-hammering 12:46:38
13 Jun 2021
@yusdacra:tchncs.deyusdacra changed their profile picture.03:31:24
@ncfavier:matrix.orgnf hm, { foo ? bar } @ args: doesn't reflect the default value in args.foo, is that a feature? 16:40:42
@aaronjanse:matrix.orgaaronjanseI think that's intentional, although I'm not sure if everyone agrees on whether it's a feature :P16:45:35
@ncfavier:matrix.orgnfyeah i guess both choices are equally valid16:46:18
@thecannon:matrix.orgNixCannon joined the room.23:26:59

Show newer messages


Back to Room ListRoom Version: 6